react-native-code-push icon indicating copy to clipboard operation
react-native-code-push copied to clipboard

Invalid hook call?

Open pierroo opened this issue 1 year ago • 2 comments

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

  • react-native-code-push version: 7.1.0
  • react-native version: 0.69.12
  • iOS/Android/Windows version:
  • Does this reproduce on a debug build or release build? release
  • Does this reproduce on a simulator, or only on a physical device? physical device

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... :(

pierroo avatar Jan 30 '24 13:01 pierroo

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.

MikhailSuendukov avatar Mar 05 '24 17:03 MikhailSuendukov

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.

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.