Skip to content

Conversation

@1337-ishaan
Copy link

FIxed #19 issue

@vercel
Copy link

vercel bot commented Jun 18, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/resir014/react-redux-typescript-example/HzuoBNPYdxopqoMZbL86MYpNrhVS
✅ Preview: https://react-redux-typescript-example-git-fork-1337-is-33cf55-resir014.vercel.app

@1337-ishaan
Copy link
Author

@resir014 Pls look into this.

Copy link
Owner

@resir014 resir014 left a 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
Copy link
Owner

@resir014 resir014 Jul 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log(localStorage.getItem('theme'))

Please remove console.log calls.

const store = createStore(
createRootReducer(history),
initialState,
// initialState,
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Persist Selected Theme To window.localStorage

2 participants