A framework for building native applications using React
Reduce re-rendering of Animated components in Fabric
Summary: The `isFabric` method used in createAnimatedComponent is unreliable (another reason in a long list of reasons why you should not duplicate this code elsewhere, and why we want to delete it ASAP). In particular, during the first render, the ref component has not been set yet, so we /cannot/ detect if the component is Fabric or non-Fabric and assume it's non-Fabric. In Fabric, this causes `collapsable` and `nativeID` values to change after the first render. To reduce this re-rendering, but not eliminate it for all components, I've introduced a flag that indicates if a component will /never/ be flattened. In particular, Image components, ScrollViews, Text cannot ever be flattened, so we should always pass `collapsable:false` and the same nativeID prop for those components. For Animated <View>s and other components, the re-rendering issue is still a problem in Fabric for now. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D25720322 fbshipit-source-id: fe3234d8ae974911a2b5f82e4f6a093216f43d4b
J
Joshua Gross committed
b8ca59cd745ffc74a669603875e368d16fd93465
Parent: f002a57
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 12/29/2020, 6:35:15 AM