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

[v7-React-Native] Validations don't work correctly with hermes enabled (Android only) #5011

Closed
ahce opened this issue May 1, 2021 · 23 comments
Labels
improve documentation documentation update required

Comments

@ahce
Copy link

ahce commented May 1, 2021

Describe the bug
When hermes is enabled, the validations don't work, if hermes is disabled works normally.
rn-hf-hermes

To Reproduce
Steps to reproduce the behavior:

  1. clone this repo
  2. open terminal
  3. yarn install / npm install
  4. yarn start / npm start
  5. open new terminal
  6. yarn android / npm run android
  7. press submit button and check validations
  8. type in the text input and check validations
  9. disable hermes
  10. try again from step 4 to 7

Code sample link

Expected behavior
Same behavior with or without hermes
rn-hf-no-hermes

Smartphone

  • Device: Emulator
  • OS: Android 10

Environment

Tech Version
react 16.13.1
react-native 0.63.4
react-hook-form 7.3.6
@bluebill1049
Copy link
Member

@bluebill1049 bluebill1049 added the status: need more detail Please follow our issue template. label May 1, 2021
@ahce
Copy link
Author

ahce commented May 1, 2021

Try to reproduce it here: https://snack.expo.io/@bluebill1049/react-hook-form-v7---controller.

Expo doesn't have this issue because expo doesn't enable hermes.

@bluebill1049
Copy link
Member

what difference is that going to make? I am not familiar with hermes.

@bluebill1049
Copy link
Member

I would copy what's in my expo and export it to your project and test it out yourself.

@ahce
Copy link
Author

ahce commented May 1, 2021

what difference is that going to make? I am not familiar with hermes.

Hermes is a JS engine, provides some improvements, perfomance, small app and others.
I don't know it's failing with react-hook-form

@ahce
Copy link
Author

ahce commented May 1, 2021

I would copy what's in my expo and export it to your project and test it out yourself.

It also has the issue.
The submit count doesn't increment, without hermes works.

@bluebill1049
Copy link
Member

Screen Shot 2021-05-01 at 6 39 33 pm

I don't even see a submit count in my example.

@ahce
Copy link
Author

ahce commented May 1, 2021

It is a detail to detect the issue.
I added version 6 with switch to change (with v6 hermes works).
image
Please download the repo.

@bluebill1049
Copy link
Member

I am having a hard time getting it working react-native... can you reproduce that in expo app? or expo doesn't support hermes?

@ahce
Copy link
Author

ahce commented May 1, 2021

I am having a hard time getting it working react-native... can you reproduce that in expo app? or expo doesn't support hermes?

Expo doesn't use hermes.
The issue could be similar to this

I uploaded the apks:

Also I updated the repo with form state info.
image

@bluebill1049
Copy link
Member

Can u try to install a 'Proxy' ployfill? Apk doesn't really help me to debug the issue.

@bluebill1049
Copy link
Member

Screen Shot 2021-05-02 at 8 56 07 am

it's on and it's working for me.

Screen.Recording.2021-05-02.at.8.54.12.am.mp4

@bluebill1049 bluebill1049 removed the status: need more detail Please follow our issue template. label May 1, 2021
@ahce
Copy link
Author

ahce commented May 1, 2021

This issue only happens on Android, iOS doesn't enable hermes.

@bluebill1049 bluebill1049 reopened this May 1, 2021
@bluebill1049
Copy link
Member

bluebill1049 commented May 1, 2021

-_- please be more specific

@bluebill1049 bluebill1049 changed the title [v7-React-Native] Validations don't work correctly with hermes enabled [v7-React-Native] Validations don't work correctly with hermes enabled (Android only) May 1, 2021
@ahce
Copy link
Author

ahce commented May 1, 2021

proxy-polyfill solved this issue!
I updated the sample repo!

@bluebill1049
Copy link
Member

Screen Shot 2021-05-02 at 9 24 23 am

it's on ios as welll

@bluebill1049
Copy link
Member

so it's PROXY???

@ahce
Copy link
Author

ahce commented May 1, 2021

so it's PROXY???

Yes!!!

@bluebill1049
Copy link
Member

so it's PROXY???

Yes!!!

AWESOME! this needs to go into FAQ.

@bluebill1049 bluebill1049 added the improve documentation documentation update required label May 1, 2021
@ahce
Copy link
Author

ahce commented May 1, 2021

Screen Shot 2021-05-02 at 9 24 23 am

it's on ios as welll

Yes, but since react-native >= 0.64, the sample repo uses 0.63.4

@bluebill1049
Copy link
Member

bluebill1049 commented May 2, 2021

Screen Shot 2021-05-02 at 5 23 48 pm

updated, thanks for the help and investigation ahce.

@GfxKai
Copy link

GfxKai commented Nov 2, 2021

Proxy is now enabled by default from Hermes v0.7, so this step is no longer necessary https://github.com/facebook/hermes/releases/tag/v0.7.0

@bluebill1049
Copy link
Member

bluebill1049 commented Nov 2, 2021

Proxy is now enabled by default from Hermes v0.7, so this step is no longer necessary https://github.com/facebook/hermes/releases/tag/v0.7.0

we have removed proxy, so react native will share the same perf enhancement as web. will update the doc or feel free to send us a pr as well.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
improve documentation documentation update required
Projects
None yet
Development

No branches or pull requests

3 participants