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

forceUpdate should take a callback #434

Closed
Stuk opened this issue Dec 7, 2016 · 4 comments
Closed

forceUpdate should take a callback #434

Stuk opened this issue Dec 7, 2016 · 4 comments

Comments

@Stuk
Copy link

Stuk commented Dec 7, 2016

As per the React API docs

@developit
Copy link
Member

Good catch! This is a strange one since forceUpdate() is always synchronous, so there is no real purpose to the callback. However, it should be cheap/free to add (just duplicating this line) so we're probably fine to add it.

@Stuk
Copy link
Author

Stuk commented Dec 8, 2016

I think it's because React queues all component updates (e.g. in setState) and so in React it may not happen synchronously.

@developit
Copy link
Member

I don't see anything in their docs about it, but maybe it's something preact is doing unnecessarily. Perhaps forceUpdate() doesn't need to be synchronous and just has to bypass shouldComponentUpdate()...

@developit
Copy link
Member

Released in 8.

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

No branches or pull requests

2 participants