Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29452

TypeError: undefined is not an object (evaluating 'Navigator.NavigationBar')

$
0
0

I follow the book ReactNativeNotesForProfessionals.pdf and create a simple React Native application:

'use strict';import React, {Component} from 'react';import ReactNative from 'react-native';const { StyleSheet, Text, View, Navigator, Alert, TouchableHighlight } = ReactNative;class AppContainer extends Component {        renderScene(route, navigator) {                switch(route.name) {                case "Home":                        return <Home route={route} navigator={navigator} {...route.passProps} />                default:                        return (<Text route={route}                                style={styles.container}>                                Your route name is probably incorrect {JSON.stringify(route)}</Text>                        );                }        }        render() {                return (<Navigator                        navigationBar={<Navigator.NavigationBar                                style={ styles.navbar }                                routeMapper={ NavigationBarRouteMapper } />                        }                        initialRoute={{ name: 'Home' }}                        renderScene={ this.renderScene }                        />                );        }}

When I run the app in debug mode for android device, I get the error message as the title of this post.I use the following version of React Native:

vhmau@ubuntu:~/Projects/Book$ react-native -vreact-native-cli: 2.0.1react-native: 0.62.0

Please help.


Viewing all articles
Browse latest Browse all 29452

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>