question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for react-navigation-stack@2

See original GitHub issue

So 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:

IMG_EB9FFB4CA1C2-1

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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
IjzerenHeincommented, Feb 9, 2020
1reaction
TheTimeWalkercommented, Feb 13, 2020

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found