[Live] Fix parent->child fingerprint problem + always match child component #766
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Another boring PR from me to prep for 2.8 :P. This is caused by a few different changes to the system mixing together. Fixes:
A) If a parent component re-renders and the "input props" that are passed to the child differ, the child should re-render with the updated "input props". That broken in 2.8 due to a checksum problem. No fixed, and a new
updateFromParent
was added to opt into this behavior, which makes most parent-child situations simpler.B) When a parent component re-renders and the "input props" that are passed to the child have NOT changed, we render a "dummy" child element (so that we don't need to use the CPU to render a component that doesn't need to be updated). This was already the case, but until now, we always rendered as a
div
(even if the original child were anli
). I had thought we could "get away" with this (as we are discarding that fake, empty element anyways), but we couldn't. So now we render the correct tag always.Cheers!