Skip to content
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

Bug: useReducer re-renders even on same state in React 18 #42

Open
ankurrsinghal opened this issue Feb 24, 2023 · 0 comments
Open

Bug: useReducer re-renders even on same state in React 18 #42

ankurrsinghal opened this issue Feb 24, 2023 · 0 comments

Comments

@ankurrsinghal
Copy link

In React version 18, useReducer will re-render even if the reducer returns the same state. This is triggering re-renders when using the createSelectorHook.

React Issue: facebook/react#24596

I think the workaround will be to use useState instead.

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

No branches or pull requests

1 participant