-
Notifications
You must be signed in to change notification settings - Fork 218
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
Certain EventHandler props are not updated on rerender #164
Comments
Could anybody confirm this is actually/still a problem? I'm having similar issues with props used within FWIW my current workaround is setting |
Well, just try the minimal example... |
Maybe I should have formulated my question differently.
The reason I was asking is because I found two workarounds which made me wonder if my original approach (same as your example) was even intended to work:
|
Ah, I see. In your case your workarounds force the component to be reinstantiated every refresh? The bug is not expected behavior of React components so if this workaround fixes the issue without introducing unexpected behavior as in #161 I suppose it should be implemented in the package itself. |
Basically yes, I have a prop called
Component then gets refreshed, prop |
Any progress on this one? I am facing the same problem with both |
I'd be ready to review a PR fixing this ! If you do a pull request, please include tests demonstrating the fix. |
hmm I'm still running into this.. And gosh I'm working with a few libs took me a while to realise this is what causes the bug |
I think I'm running into this years later... |
I've got this issue, I have initial state every time event triggered , It looked like code works against javascript usual behaviour ) |
The cause of this bug is related to #161. In the following minimal example,
we should expect the output of
console.log(html);
inhandleKeyPress
to be equal toconsole.log(this.state.html);
. However, it is not, and the oldhandleKeyPress
handler is used that sees the initialhtml
value in its context. On the other hand,onChange
is correctly updated.The text was updated successfully, but these errors were encountered: