astoilkov / use-local-storage-state

React hook that persists data in localStorage
MIT License
1.17k stars 41 forks source link

react native support #27

Closed saleehk closed 3 years ago

astoilkov commented 3 years ago

I don't have knowledge of React Native. Do you have ideas on what should be done to add support?

mayank-budhiraja commented 3 years ago

Hello @astoilkov I can assist with react-native support. Happy to help 😄

astoilkov commented 3 years ago

@mayank-budhiraja Can you describe in a few sentences what changes are required in order to support react-native?

mayank-budhiraja commented 3 years ago

@astoilkov Mainly it will related to storage only. Components and Functions seems fine. Let me run an example and get back to you with approx changes.

astoilkov commented 3 years ago

Questions:

mayank-budhiraja commented 3 years ago

@astoilkov

astoilkov commented 3 years ago

Thanks.

I researched this more. I think it's more appropriate to make another module that is React Native only. There are just too many things that are React Native specific. This will lead to a significant increase in complexity and bundle size.

If you are interested, you can make a fork of this repo and add support for React Native. If you support both platforms, I will add the repo in the Alternatives section in the readme. This way I will help you with the promotion.

astoilkov commented 3 years ago

I am closing this issue as it lacks activity.

@mayank-budhiraja If you decide to work on a react-native version, let me know so I can add it to the readme.