diff --git a/packages/react-native/Libraries/Animated/nodes/AnimatedObject.js b/packages/react-native/Libraries/Animated/nodes/AnimatedObject.js index 0db05822131bc3..8388dd79b56995 100644 --- a/packages/react-native/Libraries/Animated/nodes/AnimatedObject.js +++ b/packages/react-native/Libraries/Animated/nodes/AnimatedObject.js @@ -23,7 +23,8 @@ function isPlainObject(value: any): boolean { return ( value !== null && typeof value === 'object' && - Object.getPrototypeOf(value).isPrototypeOf(Object) + Object.getPrototypeOf(value).isPrototypeOf(Object) && + !React.isValidElement(value) ); } @@ -81,10 +82,6 @@ export function hasAnimatedNode(value: any, depth: number = 0): boolean { } } } else if (isPlainObject(value)) { - // Don't consider React elements - if (React.isValidElement(value)) { - return false; - } for (const key in value) { if (hasAnimatedNode(value[key], depth + 1)) { return true;