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

add browser to package.json #28

Closed allencct closed 5 years ago

allencct commented 5 years ago

Compatibility issue using webpack with Microsoft Edge. Webpack prioritizes the module field over main in package.json. Module points to src while main points to dist. This creates some issues as index.js in src uses the spread operator which is not entirely supported on Edge. Issue here details the problem and offers a solution by adding the browser field into package.json.

dai-shi commented 5 years ago

I see. Thanks for the fix! Let me merge this.

(This may cause non-Edge users to use dist which is not tree shakable. I may come up with other solutions later.) edit: there's probably nothing to tree-shake in this library, so it's not a big deal...

dai-shi commented 5 years ago

Published: https://www.npmjs.com/package/react-hooks-global-state/v/0.15.1

allencct commented 5 years ago

Thanks!