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 124 forks source link

Group property doesn't include in stack navigator #210

Open kyimoemin opened 2 years ago

kyimoemin commented 2 years ago

The Group property doesn't include in the RootStack created by createSharedElementStackNavigator. In react-navigation 6 I have to use RootStack.Group tag to use a modal. When I check the types and it's only include Navigator and Screen property, not Group property.


const RootStack = createSharedElementStackNavigator();
.
.
.
return (
<RootStack.Navigator>
/**
Group property doesn't exist and shows "Couldn't find any screens for the navigator. 
Have you defined any screens as it's children?" error message
*/
  <RootStack.Group> 
    <RootStack.Screen name="name" component={Component}/>
Ong26 commented 2 years ago

Same issue here

benjamineruvieru commented 2 years ago

Am facing same issue, when are we getting a solution

austinGENEreeve commented 2 years ago

Appears to still be an issue. Anyone have a workaround for using createSharedElementStackNavigator(); and having a modal in that same stack?

austinGENEreeve commented 1 year ago

I've found you can't use groups but you can still use a modal view

add ...TransitionPresets.ModalPresentationIOS, to the screen options

Like: <MyStack.Screen name="..." component={...} options={{ ...TransitionPresets.ModalPresentationIOS, }} />

ryskin commented 1 year ago

I found the better way

    <ModalStack.Screen
      name="modalCard1"
      component={ModalView}
      options={{
        presentation: 'modal'
      }}
    />