-
Notifications
You must be signed in to change notification settings - Fork 144
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
[Question] How does splitting the component apart optimize performance #52
Comments
Read this: |
@AjaxSolutions
is corresponding to the method I mentioned? So the key point is to separating the context to avoid re-render triggered by unrelated context value? But the README in unstated-next, it seems like telling us separate the component which will be render but not the composite context. |
I'm working on a solution for splitting the hook into multiple contexts here: diegohaz/constate#93 (comment) Leaving it here because it may serve as a reference for a future work on unstated-next, but I'd love a feedback on that API too! :) cc @jamiebuilds |
In README there's a performance optimization method
I don't quite understand how it optimize performance. IMO, the separated component render as much times as before separating and I made a small demo: https://codesandbox.io/s/dark-http-selxh. The ExpensiveComponent will console as long as parent component's useContainer value changed.
Could anybody tell me about the correct understanding of it? 🤔
The text was updated successfully, but these errors were encountered: