We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Native
使用框架: React
const navBarParams = Object.assign(winScreenOptions, { title: headerTitle, headerShown: showHeader, headerTintColor: color }, screenOptions) // 页面的config if (pageConfig) { navigation.setOptions(navBarParams) }
=> /@tarojs/router-rn/src/provider.ts => handleConfig()
修改为如下,即正常:
const navBarParams = Object.assign({},{...winScreenOptions}, { title: headerTitle, headerShown: showHeader, headerTintColor: color }, screenOptions) // 页面的config if (pageConfig) { navigation.setOptions(navBarParams) }
每个子页面继承自全局rnConfig信息,且保持子页面独立rnConfig配置。 不要让后续的rnConfig,污染全局以及其他子页面。
[RN]navigation.setOptions 路由配置信息,多次跳转之后,参数污染全局winScreenOptions,导致其他子页面表现怪异。
Taro CLI 3.5.5 environment info: System: OS: macOS 12.5.1 Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.17.0 - /usr/local/bin/node Yarn: 1.22.19 - ~/.yarn/bin/yarn npm: 8.15.0 - /usr/local/bin/npm npmPackages: @tarojs/components: 3.5.5 => 3.5.5 @tarojs/helper: 3.5.5 => 3.5.5 @tarojs/plugin-framework-react: 3.5.5 => 3.5.5 @tarojs/plugin-platform-alipay: 3.5.5 => 3.5.5 @tarojs/plugin-platform-jd: 3.5.5 => 3.5.5 @tarojs/plugin-platform-qq: 3.5.5 => 3.5.5 @tarojs/plugin-platform-swan: 3.5.5 => 3.5.5 @tarojs/plugin-platform-tt: 3.5.5 => 3.5.5 @tarojs/plugin-platform-weapp: 3.5.5 => 3.5.5 @tarojs/react: 3.5.5 => 3.5.5 @tarojs/rn-runner: 3.5.5 => 3.5.5 @tarojs/rn-style-transformer: ^3.5.7 => 3.5.7 @tarojs/router: 3.5.5 => 3.5.5 @tarojs/runtime: 3.5.5 => 3.5.5 @tarojs/shared: 3.5.5 => 3.5.5 @tarojs/taro: 3.5.5 => 3.5.5 @tarojs/taro-h5: 3.5.5 => 3.5.5 @tarojs/taro-rn: 3.5.7 => 3.5.7 @tarojs/webpack5-runner: 3.5.5 => 3.5.5 babel-plugin-transform-react-jsx-to-rn-stylesheet: ^3.5.7 => 3.5.7 babel-preset-taro: 3.5.5 => 3.5.5 expo: ~46.0.1 => 46.0.16 react: ^18.2.0 => 18.2.0 react-native: 0.70.4 => 0.70.4 npmGlobalPackages: typescript: 4.8.2
The text was updated successfully, but these errors were encountered:
有修改方法,建议直接pr
Sorry, something went wrong.
const navBarParams = Object.assign({...winScreenOptions}, { title: headerTitle, headerShown: showHeader, headerTintColor: color }, screenOptions) // 页面的config if (pageConfig) { navigation.setOptions(navBarParams) }
这样就行了吧
@zhiqingchen 是的,本地测试也OK了。
Successfully merging a pull request may close this issue.
相关平台
React Native
使用框架: React
复现步骤
=> /@tarojs/router-rn/src/provider.ts
=> handleConfig()
修改为如下,即正常:
期望结果
每个子页面继承自全局rnConfig信息,且保持子页面独立rnConfig配置。
不要让后续的rnConfig,污染全局以及其他子页面。
实际结果
[RN]navigation.setOptions 路由配置信息,多次跳转之后,参数污染全局winScreenOptions,导致其他子页面表现怪异。
环境信息
The text was updated successfully, but these errors were encountered: