React native 从react本机web应用程序访问带有参数的URL
我正在开发一个React本机应用程序,我已经使用React本机Web(托管在say上)将其移植到Web 我现在想做的是定制URL,比如React native 从react本机web应用程序访问带有参数的URL,react-native,react-native-web,React Native,React Native Web,我正在开发一个React本机应用程序,我已经使用React本机Web(托管在say上)将其移植到Web 我现在想做的是定制URL,比如http://myapp.com/some/path/here/with/?params=something,我可以在我的应用程序中访问它,以便在解析后发送适当的导航操作 我的问题是,如何访问/some/path/here/maybe/with/?params=something 对于webpack dev server,每当我尝试访问saylocalhost:8
http://myapp.com/some/path/here/with/?params=something
,我可以在我的应用程序中访问它,以便在解析后发送适当的导航操作
我的问题是,如何访问/some/path/here/maybe/with/?params=something
对于webpack dev server,每当我尝试访问saylocalhost:8080/asdf
,它都会给出一个错误无法获取/asdf
我使用的是react navigation 3.3.2(与手势处理程序的web兼容性)。我访问过这个,但它讨论了从链接到屏幕的紧密耦合映射
我想要的是一些非常简单的东西,我只需要react应用程序中的某个地方的路径,这样我就可以以某种方式对其进行操作。我的用例中的一个示例: 航行中
export default createApp(
createSwitchNavigator({
HomeScreen : {screen: HomeScreen, path: ''},
Contact : {screen: Contact, path: 'Contact'},
EmailVerification : {screen : EmailVerification, path: 'confirm_email/:uid'},//<- this is how to access the page on yousite.com/confirmMail/parameterValueWithoutAnyQuestionMark
},{
initialRouteName:'HomeScreen',
})
);
导出默认createApp(
createSwitchNavigator({
主屏幕:{屏幕:主屏幕,路径:''},
联系人:{屏幕:联系人,路径:'Contact'},
EmailVerification:{屏幕:EmailVerification,路径:'confirm_email/:uid'}//
class EmailVerification extends Component{
constructor(props)
{
super(props);
this.state = {
isProcessDone : false,
uid : this.props.navigation.getParam('uid') //<- this uid paramName must be the same as in navigation
};
}
}