react-navigation-shared-element icon indicating copy to clipboard operation
react-navigation-shared-element copied to clipboard

Group property doesn't include in stack navigator

Open kyimoemin opened this issue 4 years ago • 5 comments

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}/>

kyimoemin avatar Oct 21 '21 08:10 kyimoemin

Same issue here

Ong26 avatar Nov 26 '21 17:11 Ong26

Am facing same issue, when are we getting a solution

benjamineruvieru avatar Jun 12 '22 21:06 benjamineruvieru

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

austinGENEreeve avatar Jul 17 '22 20:07 austinGENEreeve

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, }} />

austinGENEreeve avatar Oct 08 '22 15:10 austinGENEreeve

I found the better way

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

ryskin avatar Nov 17 '22 05:11 ryskin