dai-shi / react-hooks-global-state

[NOT MAINTAINED] Simple global state for React with Hooks API without Context API
https://www.npmjs.com/package/react-hooks-global-state
MIT License
1.1k stars 62 forks source link

Error: You cannot use <GlobalStateProvider> more than once. #41

Closed Temirtator closed 4 years ago

Temirtator commented 4 years ago

image

  1. This case happened, when user closing application but application living in back process
  2. Open, for example: whatsapp or any other app
  3. And then open my application again But its not always... for some reason, i dont know Thanks !!!
dai-shi commented 4 years ago

Thanks for reporting. I'm not sure why it happens either, but it means somehow GlobalStateProvider is used twice. Please note that the latest version v1.0.0 (and the next version v2.0.0) doesn't have GlobalStateProvider anymore.

Temirtator commented 4 years ago

@dai-shi wow, thanks cool. when i can check next version?

dai-shi commented 4 years ago

Which version are you using now? I recommend upgrading to v1.0.0 at this point. API has breaking changes from v0.x, but it should be easy to migrate.

v2 is coming with newer React version and is not ready (and is not working fully yet, PR here #38)

Temirtator commented 4 years ago

I have version ^0.16.0.

Ok i'll check to 1.0.0

Temirtator commented 4 years ago

@dai-shi i updated the library and removed GlobalStateProvider, so after week, if there's no any errors, i will close issue