appcues / appcues-react-native-module

The Appcues React Native Module
MIT License
10 stars 0 forks source link

React Forms not working after installing appcues SDK #136

Closed josarcsal closed 6 months ago

josarcsal commented 8 months ago

Hi! I recently installed the AppCues SDK on a React Native app and noticed that after installing it some things related to react-hook-form have stopped working making the app unusable.

The problem happens on iOS both real devices and simulators.

After the app launch, everything seems to be working fine and the AppCues flow starts correctly and show as configured on the panel except for the Inputs where we use react-hook-form and some functions seems to not work anymore, ex: watch().

The relevant part of our versions are the following:

"@appcues/react-native": "3.1.9",
"react": "18.2.0",
"react-hook-form": "7.49.3",
"react-native": "0.72.6",

Since there's no errors, warnings or traces I can't even start to work on the issue. Do you have any suggestions? Is there any more detail I can provide to help track this down? Thank you!

mmaatttt commented 8 months ago

Hi Jose, thanks for reaching out.

This is quite a strange issue and not one we've seen before. There shouldn't be any reason an Appcues flow would interfere with the behaviour of your form inputs.

A couple questions to clarify:

  1. Your text inputs only stop working after an Appcues flow is shown? ie I want to confirm that just having the Appcues SDK running isn't causing any issues
  2. Does it make a difference if your inputs are already rendered when the Appcues flow is shown? i.e. is It broken in both of these cases:
    1. Form is rendered (and working), Appcues flow shows, Form stops working
    2. Appcues flow shows, navigate to Form, Form isn't working
  3. Does the flow that's displayed include any survey blocks (ie text inputs or other form fields)? I'm guessing it's the "Test Mobile 2" flow you've been working on, so "no"?

I've created a barebones test app to try and reproduce the issue: https://github.com/mmaatttt/appcues-react-native-module-issue-136. It uses the versions you've listed and then has a couple uses of watch() on one TextInput. Then I setup Appcues to be able to launch a flow on demand. After all that, the text input still works fine with watch().

Simulator Screenshot - iPhone 15 Pro - 2024-01-25 at 16 23 54

Could you take a look at the test app and let me know if it looks like it should be an adequate reproduction of your use case?

And I know this might be a big ask, but the best thing to help us debug the issue would be if you could provide minimal sample code (like my app above) that reproduces the issue.

Thanks, Matt

josarcsal commented 7 months ago

Hi Jose, thanks for replying, I really appreciate it.

Answering your questions:

  1. Yes it stop working as soon as the Appcues flow shown, before that everything works okey, initializing the session, identifying the user and even tracking the screen but as soon as I reach a screen where the flow is triggered it stop working.

  2. The inputs are rendered after the flow is shown, we navigate to a modal which is basically a fullscreen multine input. So is Appcues flow shows, navigate to Form, Form isn't working.

  3. I does not includes any survey block that I know of. Is kind of frustrating since we want to implement this for production, we also tried to update to expo 50 an react-native 0.73.2 but nothing seems to be working and it is breaking a main feature of the app.

About providing a sample code I can't assure anything since I'm just a developer so I should ask.

Thanks, Jose

mmaatttt commented 7 months ago

Thanks for the answers. I've updated my test code to toggle the form to show after the appcues flow to match your app, but still no issues.

There's not anything more I can do to help without seeing it not working. If you're unable to share a minimal reproducible example, perhaps we can debug together on a call. If your open to this, send an email to mobile@appcues.com with your availability during EST working hours (9am-5pm, or 14:00-22:00 UTC) this week and we'll try to find a time to meet and debug together.

mjd-myob commented 1 month ago

@mmaatttt @josarcsal, we've been seeing similar issues on our project. Did we resolve this?

Relevant dependencies:

"@appcues/react-native": "^3.2.0",
"react": "18.2.0",
"react-hook-form": "^7.50.1",
"react-native": "^0.73.8",

Issue replicated specifically on iOS, version 17.5.1.

Can provide more info if needed.

mmaatttt commented 1 month ago

@mjd-myob we spent quite a bit of time debugging this, but were not able to come to a satisfying conclusion.

A minimal reproducible example would be most helpful since the issue never surfaced in my test app.

And can you confirm if you're having the same specific problem described in this issue, or it is different in some way?