humflelump / async-selector-kit

An opinionated API to simplify using async-selector
6 stars 2 forks source link

Hot reloading with react-scripts 4 gives "Error: The id "" was already given to another async selector": #16

Open jwo opened 3 years ago

jwo commented 3 years ago

If you're using react-scripts 4, it gives you hot-reloading. If you then make a change to the API function that your async-selector is using, the reloading will fail with the following error:

image

Ideally, it would just work -- maybe we need to unregister the selector if it gets unmounted somehow

github-actions[bot] commented 3 years ago

Thanks for reporting an issue! Welcome to Async Selector Kit!

humflelump commented 3 years ago

I will have to look into it but possibly removing the guarantee that ids are unique might be necessary.

humflelump commented 3 years ago

Or concat the passed id with a unique id, but probably just removing the id guarantee would be better.