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.

Navigator.NavigationBar - cannot set property '_key' of undefined

See original GitHub issue
screen shot 2016-08-26 at 13 41 52

“react-native”: “0.32.0”,

tested with the example code still getting this error ?

test code

class App extends Component {
  render() {
    const routes = [
      {title: 'First Scene', index: 0},
      {title: 'Second Scene', index: 1},
    ];
    return (
      <Navigator
        initialRoute={routes[0]}
        initialRouteStack={routes}
        renderScene={(route, navigator) =>
          <TouchableHighlight onPress={() => {
            if (route.index === 0) {
              navigator.push(routes[1]);
            } else {
              navigator.pop();
            }
          }}>
          <Text>Hello {route.title}!</Text>
          </TouchableHighlight>
        }
        style={{padding: 100}}
        navigationBar={
           <Navigator.NavigationBar
             routeMapper={{
               LeftButton: (route, navigator, index, navState) =>
                { return (<Text>Cancel</Text>); },
               RightButton: (route, navigator, index, navState) =>
                 { return (<Text>Done</Text>); },
               Title: (route, navigator, index, navState) =>
                 { return (<Text>Awesome Nav Bar</Text>); },
             }}
             style={{backgroundColor: 'gray'}}
           />
        }
      />
    );
  }
}


Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
samuelkraftcommented, Aug 29, 2016

I have a similar error. undefined is not and object (evaluating '_this._key = guid()') in NavigatorNavigationsBar.js:114 after upgrading to 0.32.

Building with Xcode 8 for iOS 10 - not sure if related.

1reaction
ardavankcommented, Oct 22, 2016

I still have the same issue using RN 0.35.0

Screen Shot 2016-10-22 at 15.13.24.png

 <Navigator
                style = { styles.container }
                navigationBar={
                    <Navigator.NavigationBar
                        routeMapper={{
                            LeftButton: (route, navigator, index, navState) =>
                            { return (<Text>Cancel</Text>); },
                            RightButton: (route, navigator, index, navState) =>
                            { return (<Text>Done</Text>); },
                            Title: (route, navigator, index, navState) =>
                            { return (<Text>Awesome Nav Bar</Text>); },
                        }}
                        style={{backgroundColor: 'gray'}}
                    />
                }
                initialRoute = { { name: ROUTES.TODOS } }
                renderScene = { this.renderScene.bind(this) }
                configureScene = { () => { return Navigator.SceneConfigs.FloatFromRight; } } />
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property of 'navigate' of undefined - Stack Overflow
This is happening because the navigation prop is passed to the Berita component and you are destructuring the property in Item component not ......
Read more >
Native Stack Navigator | React Navigation
Native Stack Navigator provides a way for your app to transition between screens where each new screen is placed on top of a...
Read more >
BottomNavigationBar class - material library - Dart API
A material widget that's displayed at the bottom of an app for selecting among a small number of views, typically between three and...
Read more >
Personalize the Navigation Bar in Lightning Experience
You can't rename or remove items that your admin has specified for the app. Review your changes to the nav bar. To make...
Read more >
cannot read properties of undefined navigate - You.com
Cannot read property 'navigate' of Undefined in React Navigation ... First I created Home Screen which has four buttons One with name Upsc...
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