javascript - React-navigation undefined Error -
i have interesting question: import
<touchableopacity onpress={() => this.props.navigation.navigate('feed')} style={styles.buttoncontainer}> <text style={styles.buttontext}> login </text> </touchableopacity> button form created, import screen want load form on this:
<keyboardavoidingview behavior='padding' style={styles.container}> <view style={styles.logo}> <text style={{fontsize: 64, color: '#34b3e4'}}>partner<text style={{fontsize: 64, color: '#0077b5'}}>up</text></text> <text style={{fontsize: 13, opacity: 0.8, color: '#0077b5'}}>we connect you. work easier.</text> </view> <loginform/> <-------------------here import <view style={styles.accountlogin}> <touchableopacity onpress={() => this.props.navigation.navigate('forgot')}> <text style={{opacity: 0.9,color:'#34b3e4'}} >forgot password? </text> </touchableopacity> </view> </keyboardavoidingview> but onpress function transition screens doesnt want relay , throws undefined error cant import , render onpress function anywhere in router:
feed: { screen: feed, navigationoptions: { title: 'mentor', header:{ right: //going users profile picture <icon onpress={() => this.props.navigation.navigate('profile')} name="user" color='#0077b5' size={30} />, left: //messages <icon name="message" color='#0077b5' size={30} />, titlestyle: { color: '#0077b5' }, } } }, what have exactly
you need pass properties child component to
change
<loginform/> to
<loginform navigation={this.props.navigation}/> for work in navigator, use reference
<navigator ref='navigator' ... /> and
<icon navigator={this.refs.navigator} />
Comments
Post a Comment