问题描述
预期结果:应该会打开“注册”屏幕
点击链接:url:'exp://kj-97q.anonymous.metordunia.exp.direct:80 /-/ signup'
问题:请提出我在做什么错
export default class App extends React.Component {
componentDidMount (){
// If the app is NOT already open and the app is opened by clicking an url-->handle an initial url on app opening
Linking.getinitialURL().then( ( url)=>{
const {path,queryParams }=Linking.parse(url);
console.log("path url from if the app is NOT already opened get intiial url:",path);
console.log("path url quary parameter:",queryParams);
console.log(`Linked to app with path: ${path} and data: ${JSON.stringify(queryParams)}`);
this.props.navigation.navigate(path,queryParams);
});
// If the app is YES already open and the app is opened by clicking an url-->handle an initial url on app opening
Linking.addEventListener("url",event=>{
this.urlRedirect(event.url)
}
)
}
urlRedirect=(url)=>{
if (! url) return;
// parse and redirect to new url
const {path,queryParams }=Linking.parse(url);
console.log("path url if app is YES already opened add event listener :",queryParams);
console.log(`Linked to app with path: ${path} and data: ${JSON.stringify(queryParams)}`);
this.props.navigation.navigate(path,queryParams);
}
-
导航器详细信息
const AppNavigator = createBottomTabNavigator({
Login: { screen: Loginstack,path:login,},Signup: { screen: Signupstack,path:'signup',
},
-
控制台日志
path url quary参数:对象{}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)