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

Will same state trigger the effect? #1

Open
babipal opened this issue Sep 14, 2021 · 2 comments
Open

Will same state trigger the effect? #1

babipal opened this issue Sep 14, 2021 · 2 comments

Comments

@babipal
Copy link

babipal commented Sep 14, 2021

}, [state]);

I like the idea behind this hook, but will the above effect run if the state value is a primitive that didn't change?

@kuasha420
Copy link
Owner

It should not run for same value when it's a primitive. You can use an object ie. {value: "primitive"} to force the effect.

@calvinte
Copy link

This PR makes the promise always resolve: #2

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

3 participants