fix case where we would omit the ref from reused vnodes#3696
Merged
Conversation
📊 Tachometer Benchmark ResultsSummaryduration
usedJSHeapSize
Results02_replace1k
duration
usedJSHeapSize
run-warmup-0
run-warmup-1
run-warmup-2
run-warmup-3
run-warmup-4
run-final
03_update10th1k_x16
duration
usedJSHeapSize
07_create10k
duration
usedJSHeapSize
filter_list
duration
usedJSHeapSize
hydrate1k
duration
usedJSHeapSize
many_updates
duration
usedJSHeapSize
text_update
duration
usedJSHeapSize
|
|
Size Change: +27 B (0%) Total Size: 44 kB
ℹ️ View Unchanged
|
JoviDeCroock
commented
Aug 27, 2022
| render(<App count={0} />, scratch); | ||
| expect(calls[0]).to.equal(scratch.firstChild.firstChild); | ||
| render(<App count={1} />, scratch); | ||
| expect(calls[1]).to.equal(null); |
Member
Author
There was a problem hiding this comment.
this seems to still be called in the wrong order for functions i.e. applyRef(null); applyRef(element);
This could be similar to v11 ref ordering #3493 i.e. we basically unmount the parent but have already applied the ref as part of the diff in the child - this could be because our equality logic falls apart as we have no oldVNode to match against
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixes #3695
I think this should be a safe change as the ref from a reused element i.e.
const x = <div ref={ref}>will always point at the same ref