dai-shi / react-hooks-global-state

[NOT MAINTAINED] Simple global state for React with Hooks API without Context API

Home Page:https://www.npmjs.com/package/react-hooks-global-state

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Temirtator opened this issue · comments

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 !!!

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.

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

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)

I have version ^0.16.0.

Ok i'll check to 1.0.0

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