-
Notifications
You must be signed in to change notification settings - Fork 146
persisting selected theme to localStorage #35
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
base: master
Are you sure you want to change the base?
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/resir014/react-redux-typescript-example/HzuoBNPYdxopqoMZbL86MYpNrhVS |
|
@resir014 Pls look into this. |
resir014
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@1337-ishaan Sorry, I just got time to look into this. I got some comments for you to look into.
Also, please remove the package-lock.json file.
| // https://github.com/piotrwitek/react-redux-typescript-guide#state-with-type-level-immutability | ||
| export interface LayoutState { | ||
| readonly theme: ThemeColors | ||
| theme: ThemeColors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| theme: ThemeColors | |
| theme: ThemeColors |
| // Create the `setTheme` handler. We use the `dispatch` we got from `useDispatch()` to create said selector. | ||
| const setTheme = (color: ThemeColors) => dispatch(layoutActions.setTheme(color)) | ||
|
|
||
| console.log(localStorage.getItem('theme')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| console.log(localStorage.getItem('theme')) |
Please remove console.log calls.
| const store = createStore( | ||
| createRootReducer(history), | ||
| initialState, | ||
| // initialState, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this commented out?
FIxed #19 issue