IjzerenHein / react-navigation-shared-element

React Navigation bindings for react-native-shared-element 💫
https://github.com/IjzerenHein/react-native-shared-element
MIT License
1.27k stars 123 forks source link

BUG CRASH: Maximum call stack size exceeded (native stack depth) #278

Open fukemy opened 1 year ago

fukemy commented 1 year ago

Hi, I have nested navigator like this:

const PollStack = () => {
    return <Stack.Navigator>
      <Stack.Screen name='PollScreen' component={PollScreen} options={{ ...defaultNavProps }}/>
      <Stack.Screen name='CreatePollConfig' component={CreatePollConfigScreen} options={{ ...defaultNavProps }}/>
    </Stack.Navigator>
  }

here is main navigator:

<NavigationContainer ref={RootNavigation.navigationRef}
                          onReady={() => {
                            SplashScreen.hide()
                            RootNavigation.isReadyRef.current = true
                          }}>
                          <Host>
                            <Stack.Navigator>
                                <>
                                  <Stack.Screen name='PollStack' component={PollStack}
                                    options={{
                                      ...defaultNavProps,
                                      presentation: 'fullScreenModal',
                                      headerShown: false
                                    }} />
                                <>
                            </Stack.Navigator>
                          </Host>
</NavigationContainer>

here is navigation call method:

 RootNavigation.push('MyNoteStack', {
          screen: 'MyNoteScreen'
        })

=> navigationRef.current.dispatch(StackActions.push(name, params)) //RootNavigation

then I got crash:

 ERROR  RangeError: Maximum call stack size exceeded (native stack depth)

This error is located at:
    in SharedElementSceneView (at SceneView.tsx:132)
    in StaticContainer
    in EnsureSingleNavigator (at SceneView.tsx:124)
    in SceneView (at useDescriptors.tsx:217)
    in RCTView (at View.js:32)
    in View (at DebugContainer.native.tsx:27)
    in DebugContainer (at NativeStackView.native.tsx:76)
    in MaybeNestedStack (at NativeStackView.native.tsx:247)
    in RNSScreen (at createAnimatedComponent.js:211)
    in AnimatedComponent (at createAnimatedComponent.js:264)
    in AnimatedComponentWrapper (at src/index.native.tsx:281)
    in MaybeFreeze (at src/index.native.tsx:280)

...

Please help

fukemy commented 1 year ago

when revert back to const Stack = createNativeStackNavigator(), everything work ok

serp1412 commented 8 months ago

I'm having the same problem. Please help

fukemy commented 8 months ago

I'm having the same problem. Please help

remove this dead lib then use reanimated-shared-element