-
Notifications
You must be signed in to change notification settings - Fork 41
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
Render from the topmost dirty component downward #38
Comments
Yeah I noticed this. Each Component enqueues a render when it's state changes and is adding a separate render run loop handler. React handles this via keeping tracking of a component's owner. React distinguishes a component's owner versus it's parent. Each component can have only one owner of course, the react component that gave it it's properties. There is a single global In a parallel native environment you probably don't want to use the global flag. |
Currently each component re-renders itself when its state changes. This works, but it's less than ideal.
Consider a component A which renders a component B. If both update their state in the same runloop, component B will be rendered twice: once by itself because of its state update, and once when component A re-renders itself.
We should start each re-render from the topmost dirty component.
(I don't think there are any correctness problems here, but it's certainly less performant.)
The text was updated successfully, but these errors were encountered: