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
navigateTo
H5
https://github.com/tomtiao/taro-h5-router-forward-back.git 浏览器版本: Chrome 114, Firefox 115 使用框架: React
不卸载首页 首页Count保留状态
在第5步前进后,首页被卸载 第6步返回后首页Count还原为0,useLoad钩子再次触发打印Page loaded.
useLoad
Page loaded.
👽 Taro v3.6.8 Taro CLI 3.6.8 environment info: System: OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish) Shell: 5.8.1 - /usr/bin/zsh Binaries: Node: 14.21.3 - ~/.nvm/versions/node/v14.21.3/bin/node Yarn: 1.22.19 - /mnt/c/Program Files/nodejs/yarn npm: 6.14.18 - ~/.nvm/versions/node/v14.21.3/bin/npm npmPackages: @tarojs/cli: 3.6.8 => 3.6.8 @tarojs/components: 3.6.8 => 3.6.8 @tarojs/helper: 3.6.8 => 3.6.8 @tarojs/plugin-framework-react: 3.6.8 => 3.6.8 @tarojs/plugin-platform-alipay: 3.6.8 => 3.6.8 @tarojs/plugin-platform-h5: 3.6.8 => 3.6.8 @tarojs/plugin-platform-jd: 3.6.8 => 3.6.8 @tarojs/plugin-platform-qq: 3.6.8 => 3.6.8 @tarojs/plugin-platform-swan: 3.6.8 => 3.6.8 @tarojs/plugin-platform-tt: 3.6.8 => 3.6.8 @tarojs/plugin-platform-weapp: 3.6.8 => 3.6.8 @tarojs/react: 3.6.8 => 3.6.8 @tarojs/runtime: 3.6.8 => 3.6.8 @tarojs/shared: 3.6.8 => 3.6.8 @tarojs/taro: 3.6.8 => 3.6.8 @tarojs/taro-loader: 3.6.8 => 3.6.8 @tarojs/webpack5-runner: 3.6.8 => 3.6.8 babel-preset-taro: 3.6.8 => 3.6.8 eslint-config-taro: 3.6.8 => 3.6.8 react: ^18.0.0 => 18.2.0
没有细看,不过在点击浏览器前进按钮时,似乎unload方法会直接将栈顶元素弹出
unload
The text was updated successfully, but these errors were encountered:
因为浏览器在点击前进时会触发 POP 事件,路由会判断为后退
该情况只能规避,浏览器限制
Sorry, something went wrong.
No branches or pull requests
相关平台
H5
复现仓库
https://github.com/tomtiao/taro-h5-router-forward-back.git
浏览器版本: Chrome 114, Firefox 115
使用框架: React
复现步骤
期望结果
不卸载首页
首页Count保留状态
实际结果
在第5步前进后,首页被卸载
第6步返回后首页Count还原为0,
useLoad
钩子再次触发打印Page loaded.
环境信息
补充信息
没有细看,不过在点击浏览器前进按钮时,似乎
unload
方法会直接将栈顶元素弹出The text was updated successfully, but these errors were encountered: