i'm using RN 0.46.0 and after setup the login component i'm trying to use the navigator to push another component. but shows this
Cannot read property 'push' of undefined
When i click at the button
Even the docs just have this way to get another component.
Someone know if this is related to the version?
Or for Navigation need to create a route?
import React, {Component} from 'react';
import { Text, View, Navigator, TouchableHighlight } from 'react-native';
import { Card, CardSection, Input, Button } from './common';
import Signup from './Signup';
class Login extends Component {
goToSignup(){
this.props.navigator.push({
component: Signup
});
}
render() {
return(
<Card>
<CardSection>
</CardSection>
<CardSection>
<Input
placeholder="Email"
/>
</CardSection>
<CardSection>
<Input
secureTextEntry
placeholder="Password"
/>
</CardSection>
<CardSection>
<Button>
Log In
</Button>
</CardSection>
<CardSection>
<TouchableHighlight onPress={this.goToSignup.bind(this)}>
<Text >
Go to Sign up
</Text>
</TouchableHighlight>
</CardSection>
</Card>
);
}
}
export default Login;