-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
useEffect's disposer should be called before update #335
Comments
Not a bug, but that could be a reasonable change. |
AFAIK react follow this. It's surprising to me that I didn't know this until now. |
It may be a breaking change but if I make a PR then it can be merged? |
Honestly I'm not sure. If that's how React behaves. there's some value in keeping it that way. And nobody complained so far either. If this gets a bunch of 👍, sure. But for now I'd prefer to wait for the confirmation that other people want this too. |
@jeiea Can you reproduce this code in React and share so that we can be certain it's inconsistent? |
Is the stackoverflow answer enough? |
What I did and description
I don't know whether it is a bug but I'll explain it first.
I thought dispose function (printing
unmount
in the following code) should be called first after first mount. But it seems not.Is it intended?
git clone -b effect_hook https://github.com/jeiea/flutter_example.git
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: