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
微信小程序
小程序基础库: 2.30.2 使用框架: React
// app.tsx class App extends React.Component { componentDidMount() {} taroGlobalData = { test: 123} ... } // some native wx page: pages/SomeWxPage/SomeWxPage.js Page({ onLoad() { console.log(getApp().test) // undefined } })
如果用户 直接启动小程序 打开 pages/SomeWxPage/SomeWxPage,就会报错。
getApp().test 预期取到 123。另外希望指导下原生页面获取taroGlobalData的正确方法
getApp().test 得到 undefined
Taro v3.5.12 Taro CLI 3.5.12 environment info: System: OS: macOS 12.6.8 Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v18.15.0/bin/yarn npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm npmPackages: @tarojs/cli: 3.5.12 => 3.5.12 @tarojs/components: 3.5.12 => 3.5.12 @tarojs/helper: 3.5.12 => 3.5.12 @tarojs/plugin-framework-react: 3.5.12 => 3.5.12 @tarojs/plugin-platform-alipay: 3.5.12 => 3.5.12 @tarojs/plugin-platform-jd: 3.5.12 => 3.5.12 @tarojs/plugin-platform-qq: 3.5.12 => 3.5.12 @tarojs/plugin-platform-swan: 3.5.12 => 3.5.12 @tarojs/plugin-platform-tt: 3.5.12 => 3.5.12 @tarojs/plugin-platform-weapp: 3.5.12 => 3.5.12 @tarojs/react: 3.5.12 => 3.5.12 @tarojs/router: 3.5.12 => 3.5.12 @tarojs/runtime: 3.5.12 => 3.5.12 @tarojs/shared: 3.5.12 => 3.5.12 @tarojs/taro: 3.5.12 => 3.5.12 @tarojs/taro-h5: 3.5.12 => 3.5.12 @tarojs/webpack5-runner: 3.5.12 => 3.5.12 babel-preset-taro: 3.5.12 => 3.5.12 eslint-config-taro: 3.5.12 => 3.5.12 react: ^18.0.0 => 18.2.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
相关平台
微信小程序
小程序基础库: 2.30.2
使用框架: React
复现步骤
如果用户 直接启动小程序 打开 pages/SomeWxPage/SomeWxPage,就会报错。
期望结果
getApp().test 预期取到 123。另外希望指导下原生页面获取taroGlobalData的正确方法
实际结果
getApp().test 得到 undefined
环境信息
The text was updated successfully, but these errors were encountered: