navigator push 失败



  • 报错:undefinded is not an object(evaluating 'this.props.navigator.push')

    代码如下:
    class Day3 extends Component {
    cart() {
    this.props.navigator.push({
    component: Detail,
    title: 'Cart',
    passProps: {myProp: 'genius'},
    });
    }
    render() {
    return (
    <NavigatorIOS
    style={{flex:1}}
    initialRoute={{
    component:MainView,
    title:'新闻',
    rightButtonTitle: 'Cart',
    onRightButtonPress: () => this.cart(),
    }}

      />
    );
    

    }
    }


登录后回复