Add support for react-navigation-stack@2
See original GitHub issueSo im trying to use this in a new project (used the library totally fine previously) and with the basic code:
import { createStackNavigator } from 'react-navigation-stack';
import { createSharedElementStackNavigator } from 'react-navigation-shared-element';
import { OnboardingScreen, LoginScreen } from 'app/src/views/screens';
const GuestNavigator = createSharedElementStackNavigator(
createStackNavigator,
{
Onboard: OnboardingScreen,
Login: LoginScreen
},
{
initialRouteName: 'Onboard',
defaultNavigationOptions: {
cardStyle: { backgroundColor: 'transparent' },
headerStyle: {
backgroundColor: 'transparent'
}
}
}
);
export { GuestNavigator };
Im using react-navigation ^v4.0.10 and react-navigation-stack ^2.0.12 The app crashes instantly with that code and I get this:
Obviously replace
const GuestNavigator = createSharedElementStackNavigator(
createStackNavigator,
...
with
const GuestNavigator = createStackNavigator(
...
and its totally fine
Being aware that react navigation v5 looks to be completely different am I just SOL right now with this (I’ve looked at the code and im totally stumped as to how it works - it seems completely black box to me right now, so don’t even know how to manually fix this)
Any help or direction on where to look at fixing this will be greatly appreciated
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Stack Navigator | React Navigation
Stack Navigator provides a way for your app to transition between screens where each new screen is placed on top of a stack....
Read more >react-navigation-stack - npm
Stack navigator component for React Navigation. Latest version: 2.10.4, last published: 2 years ago. Start using react-navigation-stack in ...
Read more >Getting Started with the React Navigation | Codementor
React Navigation library Support Stack Navigation, Tab Navigation and ... Do npm install @react-navigation/stack 2. go to cd ios/ folder 3.
Read more >Getting Started with Stack Navigator Using react ... - Heartbeat
This function returns two React components: Screen and Navigator , which help us configure each component screen. For now, let's add one screen...
Read more >react-navigation-stack | Yarn - Package Manager
Stack navigator for use on iOS and Android. Installation. Open a Terminal in your project's folder and run, yarn add react-navigation-stack @react-native- ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Support for stack v2 has been officially released. https://github.com/IjzerenHein/react-navigation-shared-element/releases/tag/v2.0.1
Hey, after taking a small break with this task and later noticing that I accidentally had shared instead of id in
<SharedElement>
since I’m moving away from FluidTransitions 🤦♂️, I was able to make it work without issues. Sorry about that and thanks for updating this for Stack v2!