nutui-react
nutui-react copied to clipboard
ConfigProvider中的useConfig报错`'style' of undefined`
NutUI React 包名
@nutui/nutui-react-taro
NutUI React 版本号
2.6.14
平台
weapp
重现链接
https://github.com/chioio/nutui-taro-configprovider-error
重现步骤
- 初始化Taro NutUI App
- 修改babel import配置
- 使用ConfigProvider
- 使用useConfig
- 报错
[email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:98 TypeError: Cannot read property 'style' of undefined
at ConfigProvider (._node_modules_.pnpm_@[email protected][email protected][email protected][email protected]_node_modules_@nutui_nutui-react-taro_dist_esm_configprovider.taro-DA4GDDFu.js:179)
at Demo (index.jsx?f47a:29)
at Ke ([email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:78)
at Sh ([email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:196)
at Rh ([email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:186)
at Qh ([email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:186)
at Gh ([email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:186)
at Lh ([email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:177)
at Eh ([email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:175)
at workLoop ([email protected]_node_modules_scheduler_cjs_scheduler.development.js:266)(env: macOS,mp,1.06.2405020; lib: 3.5.3)
Tip: NutUI React 正常
期望的结果是什么?
调用 useConfig
正常
实际的结果是什么?
报错 style of undefined
环境信息
Taro CLI 3.6.34 environment info: System: OS: macOS 13.6.7 Shell: 5.9 - /bin/zsh Binaries: Node: 18.12.0 - ~/Library/Caches/fnm_multishells/25267_1653168489651/bin/node Yarn: 1.22.22 - /usr/local/bin/yarn npm: 8.19.2 - ~/Library/Caches/fnm_multishells/25267_1653168489651/bin/npm npmPackages: @tarojs/cli: 3.6.34 => 3.6.34 @tarojs/components: 3.6.34 => 3.6.34 @tarojs/helper: 3.6.34 => 3.6.34 @tarojs/plugin-framework-react: 3.6.34 => 3.6.34 @tarojs/plugin-html: 3.6.34 => 3.6.34 @tarojs/plugin-platform-alipay: 3.6.34 => 3.6.34 @tarojs/plugin-platform-h5: 3.6.34 => 3.6.34 @tarojs/plugin-platform-jd: 3.6.34 => 3.6.34 @tarojs/plugin-platform-qq: 3.6.34 => 3.6.34 @tarojs/plugin-platform-swan: 3.6.34 => 3.6.34 @tarojs/plugin-platform-tt: 3.6.34 => 3.6.34 @tarojs/plugin-platform-weapp: 3.6.34 => 3.6.34 @tarojs/react: 3.6.34 => 3.6.34 @tarojs/runtime: 3.6.34 => 3.6.34 @tarojs/shared: 3.6.34 => 3.6.34 @tarojs/taro: 3.6.34 => 3.6.34 @tarojs/taro-loader: 3.6.34 => 3.6.34 @tarojs/webpack5-runner: 3.6.34 => 3.6.34 babel-preset-taro: 3.6.34 => 3.6.34 eslint-config-taro: 3.6.34 => 3.6.34 react: ^18.0.0 => 18.3.1
其他补充信息
No response