Repository navigation
Open
Description
Simulator.Screen.Recording.-.iPhone.SE.3rd.generation.-.2022-06-07.at.11.45.27.mp4
This is where I create the Navigation Container
const Root: React.FC<RootProps> = ({}) => {
const theme = useTheme()
return (
<SafeAreaView
style={{ backgroundColor: theme.colors.background, ...tw`flex-1` }}
>
<NavigationContainer>
<Stack.Navigator initialRouteName='Today'>
<Stack.Screen
name='Today'
component={HomePage}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name='CardDetail'
component={CardDetail}
options={{
headerShown: false,
cardStyle: {
opacity: 1,
},
cardStyleInterpolator: ({ current }) => ({
cardStyle: {
opacity: current.progress,
},
}),
}}
sharedElements={(route, otherRoute, showing) => {
return [
`birth_chart`,
`${route.name}.${route.key}.background`,
`${route.name}.${route.key}.compact`,
{
id: `${route.name}.${route.key}.expanded`,
resize: 'clip',
animation: 'fade',
},
{
id: `${route.name}.${route.key}.back_button`,
resize: 'clip',
animation: 'fade',
},
]
}}
/>
</Stack.Navigator>
</NavigationContainer>
</SafeAreaView>
)
}This is the CardDetail component:
const CardDetail: NavigationStackScreenComponentWithSharedComponent<
CardDetailProps,
RootStackParamList,
'CardDetail'
> = ({ navigation, route }) => {
const theme = useTheme()
const birthChartProviderState = route.params?.birthChartProviderState
return (
<ScrollView style={{ backgroundColor: theme.colors.background, flex: 1 }}>
<SkiaBirthChartProvider syncState={birthChartProviderState}>
<SharedElement id='birth_chart'>
<BirthChart />
</SharedElement>
<View style={tw`px-4`}>
<SunInSignCard
expanded
onBack={() => {
navigation.pop()
}}
/>
</View>
</SkiaBirthChartProvider>
</ScrollView>
)
}All the shared elements are defined in the SunInSignCard component, for example:
<SharedElement
id='CardDetail.sun_in_sign.background'
style={{
...tw`absolute inset-0`,
}}
>
<View
style={{
...tw`rounded-xl w-full h-full bg-white`,
}}
/>
</SharedElement>
What could be causing this?
I'm using:
- "expo": "~45.0.0"
- "react-native": "0.68.2"
- "react-native-shared-element": "0.8.4"
- "react-navigation-shared-element": "^3.1.3"
- "@react-navigation/native": "^6.0.10"
- "@react-navigation/native-stack": "^6.6.2"
- "@react-navigation/stack": "^6.2.1"
Reacted by Christopher Dengsø
Metadata
Metadata
Assignees
Labels
No labels
Activity
fukemy commentedon Dec 1, 2022
hi, how did u make your app run? I got this problem:
package json:
gabrielvincent commentedon Dec 1, 2022
@fukemy It looks like
@react-navigation/stackis missing. Trynpm i @react-navigation/stackoryarn add @react-navigation/stack.fukemy commentedon Dec 1, 2022
thanks, i forgot it
hashhirr commentedon Apr 26, 2024
how did you resolved your issue?
gabrielvincent commentedon Apr 26, 2024
I didn't. I ended up choosing a simpler UI without a lot of fluff.