react-boilerplate / react-boilerplate-cra-template

:fire: Setup Create React App with React Boilerplate. Highly scalable & Best DX & Performance Focused & Best practices.
https://react-boilerplate.github.io/react-boilerplate-cra-template/
MIT License
1.87k stars 393 forks source link

Redux Persist #123

Closed farmanalibhatti closed 3 years ago

farmanalibhatti commented 3 years ago

Is there a prebuilt feature for redux-persist in this boilerplate? Can you give an example for this specific one?

Can-Sahin commented 3 years ago

https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/110

AleXzpm commented 3 years ago

@farmanalibhatti did you manage to add persist to this?

farmanalibhatti commented 3 years ago

@farmanalibhatti did you manage to add persist to this?

No, I just added a two custom routes.

  1. PrivateRoute
  2. PublicRoute They check the local data and load them to redux state as needed.
farmanalibhatti commented 3 years ago

If you solve this issue, do let me know. I want to add persist to my project.

wildcant commented 3 years ago

Hey guys I'm having the same issue, I tried adding persist as redux toolkit docs says but I had no luck, it might be a problem with boilerplate injectors, I'm waiting for this issue to be resolved also. @Can-Sahin What do you think might the problem? the issue above has a code snippet that shows the boilerplate implementation of persist as redux toolkit suggest.

AleXzpm commented 3 years ago

@CwirL yes, I also opened that issue good that you linked it here also. I'm sure the problem is the injector. I hope the person who rote the injector/boilerplate can look into it.

Can-Sahin commented 3 years ago

I see that dynamic reducers can be the problem. I would suggest not using injectors and just go for the standard redux approach, adding reducers statically. Same for the redux-saga. After all, you can fully customize the boilerplate. No need to stick to injectors blindly.

aryan880 commented 2 years ago

Unable to implement redux-persist in react cra boilerplate! Did you guys manage to add the forementioned?