Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple user interaction events sent to SDK when using reusable button components #425

Open
conorshaw opened this issue Mar 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@conorshaw
Copy link

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 trackInteractions to true
  • Create a component which accepts an onPress prop and then passes it to a TouchableOpacity component onPress prop
  • 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"
@conorshaw conorshaw added the bug Something isn't working label Mar 13, 2023
@louiszawadzki
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants