From 1b4c36b37a46f3526ad70f5e6db5ba1757b75251 Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Thu, 11 Mar 2021 11:56:34 +0100 Subject: [PATCH 1/2] Set missing viewRef for animatedProps --- src/createAnimatedComponent.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/createAnimatedComponent.js b/src/createAnimatedComponent.js index 67f68c66aad..b35055b231b 100644 --- a/src/createAnimatedComponent.js +++ b/src/createAnimatedComponent.js @@ -396,6 +396,9 @@ export default function createAnimatedComponent(Component) { } else if (key === 'animatedProps') { Object.keys(value.initial).forEach((key) => { props[key] = value.initial[key]; + if (value.viewRef?.current === null) { + value.viewRef.current = this; + } }); } else if (value instanceof AnimatedEvent) { // we cannot filter out event listeners completely as some components From f11840c12d3abd7d4016849abacc424b5a75869f Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Fri, 12 Mar 2021 16:34:58 +0100 Subject: [PATCH 2/2] Removed unnecessary nullcheck --- src/createAnimatedComponent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/createAnimatedComponent.js b/src/createAnimatedComponent.js index b35055b231b..ecfb8302ceb 100644 --- a/src/createAnimatedComponent.js +++ b/src/createAnimatedComponent.js @@ -396,7 +396,7 @@ export default function createAnimatedComponent(Component) { } else if (key === 'animatedProps') { Object.keys(value.initial).forEach((key) => { props[key] = value.initial[key]; - if (value.viewRef?.current === null) { + if (value.viewRef.current === null) { value.viewRef.current = this; } });