From 4567dc6cd2ed1d0f84e5910d71577a197ae14d39 Mon Sep 17 00:00:00 2001 From: Hein Rutjes Date: Fri, 30 Aug 2019 12:11:56 +0200 Subject: [PATCH] fix: fixed funky transition stuff from happening when popping a route --- src/createSharedElementScene.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/createSharedElementScene.tsx b/src/createSharedElementScene.tsx index a5c4cf3..791b25e 100644 --- a/src/createSharedElementScene.tsx +++ b/src/createSharedElementScene.tsx @@ -23,6 +23,7 @@ function createSharedElementScene( rendererData: ISharedElementRendererData ): React.ComponentType { class SharedElementSceneView extends React.PureComponent { + private initial: boolean = true; private subscriptions: { [key: string]: SharedElementEventSubscription; } = {}; @@ -82,7 +83,8 @@ function createSharedElementScene( private onWillFocus = () => { const sharedElements = this.getSharedElements(); - if (sharedElements) { + if (sharedElements && this.initial) { + this.initial = false; rendererData.willActivateScene(this.sceneData, sharedElements); } };