相关平台
微信小程序
小程序基础库: 8.0.32
使用框架: React
复现步骤
taro框架react hooks,在首页写了state,详情页也写了state,首页用的Taro.navigateTo跳转到详情页,编译到微信小程序端,此时两个页面都为空白页,啥内容也没有了,然后我把详情页的useState删掉,两个页面就都恢复正常了
期望结果
在首页写了state,详情页也写了state,两个页面都正常显示
实际结果
两个页面都为空白页
环境信息
👽 Taro v3.6.5
Taro CLI 3.6.5 environment info:
System:
OS: macOS 11.5.2
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.19.0 - ~/.nvm/versions/node/v14.19.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v14.19.0/bin/yarn
npm: 6.14.16 - ~/.nvm/versions/node/v14.19.0/bin/npm
npmPackages:
@tarojs/cli: 3.6.5 => 3.6.5
@tarojs/components: 3.6.5 => 3.6.5
@tarojs/helper: 3.6.5 => 3.6.5
@tarojs/plugin-framework-react: 3.6.5 => 3.6.5
@tarojs/plugin-platform-alipay: 3.6.5 => 3.6.5
@tarojs/plugin-platform-h5: 3.6.5 => 3.6.5
@tarojs/plugin-platform-jd: 3.6.5 => 3.6.5
@tarojs/plugin-platform-qq: 3.6.5 => 3.6.5
@tarojs/plugin-platform-swan: 3.6.5 => 3.6.5
@tarojs/plugin-platform-tt: 3.6.5 => 3.6.5
@tarojs/plugin-platform-weapp: 3.6.5 => 3.6.5
@tarojs/react: 3.6.5 => 3.6.5
@tarojs/runtime: 3.6.5 => 3.6.5
@tarojs/shared: 3.6.5 => 3.6.5
@tarojs/taro: 3.6.5 => 3.6.5
@tarojs/webpack5-runner: 3.6.5 => 3.6.5
babel-preset-taro: 3.6.5 => 3.6.5
eslint-config-taro: 3.6.5 => 3.6.5
react: ^18.0.0 => 18.2.0
taro-ui: ^2.3.4 => 2.3.4
2条答案
按热度按时间41zrol4v1#
首页代码为
详情页代码为
配置文件为
ep6jt1vc2#
您还是直接给个 demo 仓库吧,
<Child />
也不知道是啥呀