microsoft / react-native-code-push

React Native module for CodePush
http://appcenter.ms
Other
8.98k stars 1.47k forks source link

Invalid hook call? #2653

Closed pierroo closed 5 months ago

pierroo commented 9 months ago

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):

Steps to Reproduce

  1. do some minimal changes
  2. push the OTA update
  3. witness some screens of the app crashing with invalid hook call for no reason

Expected Behavior

no crash

Actual Behavior

crash

the usual: 

Invariant Violation: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
    1. You might have mismatching versions of React and the renderer (such as React DOM)
    2. You might be breaking the Rules of Hooks
    3. You might have more than one copy of React in the same app
    See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.

Environment

What I really don't understand is that this screen only crashes through code puse OTA update => if I push the exact same update through the stores as usual, no crash whatsoever

There isn't even a change in this screen; it's not even affected by the update, and I know react hook rules too well. I also saw this similar issue: https://github.com/microsoft/react-native-code-push/issues/1890

but it never got any reply, and that makes codepush entirely unusable for us as it is... :(

MikhailSuendukov commented 8 months ago

Hello and sorry for the long delay! Could you please confirm what this issue still persist on latest version (8.2.1)? If not, did the solution in this thread help you? In case you have not yet found the solution, it would be very useful for us to get a small demo application for further investigation, on which this error reproduce and the steps to do it.

microsoft-github-policy-service[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

microsoft-github-policy-service[bot] commented 5 months ago

This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.