diff --git a/src/createAnimatedComponent/createAnimatedComponent.tsx b/src/createAnimatedComponent/createAnimatedComponent.tsx index 66b4a26e0be..ebeaf6364bc 100644 --- a/src/createAnimatedComponent/createAnimatedComponent.tsx +++ b/src/createAnimatedComponent/createAnimatedComponent.tsx @@ -546,7 +546,8 @@ export function createAnimatedComponent( // and later on, in componentDidUpdate, calculate translation for layout transition. getSnapshotBeforeUpdate() { if ( - (this._component as HTMLElement).getBoundingClientRect !== undefined + IS_WEB && + (this._component as HTMLElement)?.getBoundingClientRect !== undefined ) { return (this._component as HTMLElement).getBoundingClientRect(); }