Skip to content

Commit 04fbf5e

Browse files
committed
[fix] Animated no longer sets non-unique IDs on elements
Remove problematic code added only for native platforms using Fabric. Fix necolas#2136
1 parent 798d34e commit 04fbf5e

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

packages/react-native-web/src/vendor/react-native/Animated/createAnimatedComponent.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -224,39 +224,10 @@ function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
224224
this.props.passthroughAnimatedPropExplicitValues || {};
225225
const mergedStyle = {...style, ...passthruStyle};
226226

227-
// On Fabric, we always want to ensure the container Animated View is *not*
228-
// flattened.
229-
// Because we do not get a host component ref immediately and thus cannot
230-
// do a proper Fabric vs non-Fabric detection immediately, we default to assuming
231-
// that Fabric *is* enabled until we know otherwise.
232-
// Thus, in Fabric, this view will never be flattened. In non-Fabric, the view will
233-
// not be flattened during the initial render but may be flattened in the second render
234-
// and onwards.
235-
const forceNativeIdFabric =
236-
(this._component == null &&
237-
(options?.collapsable === false || props.collapsable !== true)) ||
238-
this._isFabric();
239-
240-
const forceNativeId =
241-
props.collapsable ??
242-
(this._propsAnimated.__isNative ||
243-
forceNativeIdFabric ||
244-
options?.collapsable === false);
245-
// The native driver updates views directly through the UI thread so we
246-
// have to make sure the view doesn't get optimized away because it cannot
247-
// go through the NativeViewHierarchyManager since it operates on the shadow
248-
// thread. TODO: T68258846
249-
const collapsableProps = forceNativeId
250-
? {
251-
nativeID: props.nativeID ?? 'animatedComponent',
252-
collapsable: false,
253-
}
254-
: {};
255227
return (
256228
<Component
257229
{...props}
258230
{...passthruProps}
259-
{...collapsableProps}
260231
style={mergedStyle}
261232
ref={this._setComponentRef}
262233
/>

0 commit comments

Comments
 (0)