mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
Fabric: Fixed a bug in Diffing algorithm
Summary: Before the fix, the algorithm compares ShadowViews to make a decision should it recursively call itself or not; that didn't work properly because a ShadowView doesn't fully represent the state of the subtree tree (e.g. they don't have information about children nodes). After the fix, we compare pointers to ShadowNodes (by comparing pairs). Reviewed By: mdvacca Differential Revision: D14696996 fbshipit-source-id: 560d623b15a272f13b08a11745dec6be39a5dbdd
This commit is contained in:
committed by
Facebook Github Bot
parent
0b3f99bf93
commit
5a418c5a5d
@@ -152,7 +152,7 @@ static void calculateShadowViewMutations(
|
||||
// We have to call the algorithm recursively if the inserted view
|
||||
// is *not* the same as removed one.
|
||||
const auto &newChildPair = it->second;
|
||||
if (newChildPair.shadowView != oldChildPair.shadowView) {
|
||||
if (newChildPair != oldChildPair) {
|
||||
const auto oldGrandChildPairs =
|
||||
sliceChildShadowNodeViewPairs(*oldChildPair.shadowNode);
|
||||
const auto newGrandChildPairs =
|
||||
|
||||
Reference in New Issue
Block a user