-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Enhance patch props in element by hasPropsChanged
#5773
Comments
In the body of Your proposed change would effectively save one loop over the props keys when props did not change, and add one more loop over the props keys when props did change. This seems like a small net benefit in (the likely common) scenarios where you have more elements with unchanged props than elements with changed props in a given re-render. |
I agree with you, it seems to be a balance issue at the design level, one scenario will save one loop, and one scenario will add one loop. |
see #5857 |
What problem does this feature solve?
Consider a test case like this:
oldProps
andnewProps
are actually the same when updating elemtent props, but since they are objects,oldProps !== newProps
still returntrue
like this line in rendererIs it possible to consider using
hasPropsChanged
in componentRenderUtils instead ofoldProps !== newProps
to improve performance.Please confirm if the scheme is feasible, I tried modifying to
hasPropsChanged
and all tests passed, ready to PR.What does the proposed API look like?
no proposed API
The text was updated successfully, but these errors were encountered: