dd-sdk-reactnative
dd-sdk-reactnative copied to clipboard
Multiple user interaction events sent to SDK when using reusable button components
Describe what happened
In our app we have a reusable button component which takes an onPress prop and passes it to a React Native Touchable component. What is happening when we have user interaction tracking enabled is that the SDK is sending (or at least attempting to send) two events each time (one for the onPress prop to our reusable component and another for the onPress prop to TouchableOpacity`. This is causing us to send more events than we need to or throwing a dropped event warning.
Steps to reproduce the issue:
- Set
trackInteractionstotrue - Create a component which accepts an
onPressprop and then passes it to aTouchableOpacitycomponentonPressprop - Press the component in the app and two events should be sent each time.
Describe what you expected: We expect only the actual press event itself to be sent to the SDK and not the functions which are passed to the event handler.
- Version of the SDK: "@datadog/mobile-react-native": "1.3.0",
- Version of React Native: "react-native": "0.69.8"
Hi @conorshaw, thanks for reaching out!
We're aware of this current limitation of the SDK, we're working to come up with a solution that would solve this in the next versions.
I will let you know when this is fixed.