Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single version to support React 17 and 18 #70

Closed
chkp-michaelo opened this issue Oct 9, 2024 · 3 comments
Closed

Single version to support React 17 and 18 #70

chkp-michaelo opened this issue Oct 9, 2024 · 3 comments
Labels
question Further information is requested

Comments

@chkp-michaelo
Copy link

My I/S library should support apps on both React 17 and 18.
Can I use use-local-storage-state@17 reliably for supporting both ? any drawbacks ?
No SSR, standard CRA apps

Thanks

@astoilkov
Copy link
Owner

use-local-storage-state@17 can work on both React 17 and 18. It also supports SSR, no worries there.

There is only drawback — if use-local-storage-state is used in a part of an app that has concurrent rendering and while the tree is being concurrently rendered the value in the store changes it might produce inconsistent results. However, this is a big edge case.

@astoilkov astoilkov added the question Further information is requested label Oct 9, 2024
@chkp-michaelo
Copy link
Author

Version 17 has dependency conflict with React 18:

npm ERR! Could not resolve dependency:
npm ERR! peer react@">=16.8.0 < 18" from [email protected]

It would require always running with --force flag (from dev environments, pipelines, etc) to workaround..
Any chance to loosen the React peer dependency range ?

Thanks

@astoilkov
Copy link
Owner

I liked the idea so I made the change and released a new version. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants