我現(xiàn)在需要從MinePage頁跳轉到了一個頁,代碼如下
<Text onPress={()=>{
this.props.navigator.push({
component:TagPage
})
}}>標簽頁</Text>
在使用navigator push時候報了如下錯誤
undefined is not an object (evaluating '_this2.props.navigator.push')
為啥?
簡單來說,因為咱們頁面沒有navigator這個屬性,所以報錯了些举,所以,我在根頁面把navigator屬性傳過來即可
//RootPage頁
<MinePage {...this.props} />//索性把所有屬性傳來了俭厚,簡單户魏,粗暴