persisting selected theme to localStorage#35
Open
1337-ishaan wants to merge 1 commit intoresir014:masterfrom
Open
persisting selected theme to localStorage#351337-ishaan wants to merge 1 commit intoresir014:masterfrom
1337-ishaan wants to merge 1 commit intoresir014:masterfrom
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/resir014/react-redux-typescript-example/HzuoBNPYdxopqoMZbL86MYpNrhVS |
Author
|
@resir014 Pls look into this. |
resir014
requested changes
Jul 15, 2021
Owner
resir014
left a comment
There was a problem hiding this comment.
@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 |
Owner
There was a problem hiding this comment.
Suggested change
| 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')) |
Owner
There was a problem hiding this comment.
Suggested change
| console.log(localStorage.getItem('theme')) |
Please remove console.log calls.
| const store = createStore( | ||
| createRootReducer(history), | ||
| initialState, | ||
| // initialState, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FIxed #19 issue