jkomyno / react-native-user-inactivity

Simple component that alerts when the user is inactive (i.e. when the App surface hasn't been touched for X ms)
MIT License
200 stars 56 forks source link

Conflict with React #25

Closed salomaoluiz closed 4 years ago

salomaoluiz commented 4 years ago

Hi, when I add the version v1.0, are created a folder named node_modules in the folder of the package with the folders .bin and react, this folder is conflicting with the project, resulting in the error:

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

If I delete the folder node_modules the app and lib will work again.

jkomyno commented 4 years ago

Thank you for opening this issue. I've pinged some other React developers and it looks like this error has occurred frequently in other modules that have react and react-dom as dependency. I'm merging a PR that seems to solve the problem. Please tell me whether that works for you too.

jkomyno commented 4 years ago

Please try version 1.0.1 and reopen the issue if the problem isn't gone.

salomaoluiz commented 4 years ago

Hi, unfortunately not works, I upgrade to version: "react-native-user-inactivity": "^1.0.1-beta.1", and I continue receiving the error, and if I delete node_modules folder in the lib folder, it works again.