微信小程序
https://taro-docs.jd.com/taro/docs/react/
小程序基础库: 2.11.3
使用框架: React


import { eventCenter, getCurrentInstance } from '@tarojs/taro' 爆红
vs code 提示无 getCurrentInstance 方法导出
import { eventCenter, getCurrentInstance } from '@tarojs/taro'
不爆红
爆红
Taro v3.0.2
Taro CLI 3.0.2 environment info:
System:
OS: macOS 10.15.5
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.4.0 - /usr/local/bin/node
Yarn: 1.22.0 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
npmPackages:
@tarojs/components: 3.0.2 => 3.0.2
@tarojs/mini-runner: 3.0.2 => 3.0.2
@tarojs/react: 3.0.2 => 3.0.2
@tarojs/runtime: 3.0.2 => 3.0.2
@tarojs/taro: ^3.0.2 => 3.0.2
@tarojs/webpack-runner: 3.0.2 => 3.0.2
babel-preset-taro: 3.0.2 => 3.0.2
eslint-config-taro: 3.0.2 => 3.0.2
react: ^16.13.1 => 16.13.1
npmGlobalPackages:
typescript: 3.9.5
在 @tarojs/runtime 包里, @tarojs/taro 包也是做了 re-export
我也是按文档也没有找到,是否已经解决了问题
Most helpful comment
在 @tarojs/runtime 包里, @tarojs/taro 包也是做了 re-export