Skip to content

Commit

Permalink
Disable restoreDefaultValues in Native Animated in Fabric
Browse files Browse the repository at this point in the history
Summary:
Changelog: [Internal]

# Problem

Before every update, restoreDefaults is called on animated nodes. In paper this makes sure no stale properties are on animated nodes. In paper it works fine because restoreDefaults is called before mounting and animations are triggered after mounting within single commit.

Details: #11819

In Fabric however it is called outside of other mounting operations and it applies default values to the view and then re-applies animated values.

Reviewed By: JoshuaGross

Differential Revision: D21786765

fbshipit-source-id: a2cb6d6d9cbd39d4c403c97c2f51e7d92078102f
  • Loading branch information
sammy-SC authored and facebook-github-bot committed May 29, 2020
1 parent a4757d2 commit 163ec92
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ - (void)updateView

- (void)restoreDefaultValues
{
if (_managedByFabric) {
// Restoring to default values causes render of inconsistent state
// to the user because it isn't synchonised with Fabric's UIManager.
return;
}
// Restore the default value for all props that were modified by this node.
for (NSString *key in _propsDictionary.allKeys) {
_propsDictionary[key] = [NSNull null];
Expand Down

0 comments on commit 163ec92

Please sign in to comment.