Reputation: 595
I want to store some data in my react native app.
Which one is the best practice; redux-persist
or localStorage
?
Upvotes: 0
Views: 743
Reputation: 102307
localStorage
is one of the store engines for redux-persist
. See https://github.com/rt2zz/redux-persist#storage-engines. They are not the same thing and cannot be compared. redux-persist
is in addition to the storage engine, Redux persist ships with react integration as a convenience, and generally speaking, it is enough to use.
redux-persist
provides some state Reconciler strategies that can help you reconcile states easily.
You can decide which state slice should be persisted to the store engine using Blacklist & Whitelist feature.
Upvotes: 2