Skip to content
New issue

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

文档给出 getCurrentInstance 方法无法找到 #6904

Closed
pidehen23 opened this issue Jul 3, 2020 · 2 comments
Closed

文档给出 getCurrentInstance 方法无法找到 #6904

pidehen23 opened this issue Jul 3, 2020 · 2 comments
Labels
A-typings Area - TypeScript Typings 相关 V-3 Version - 3.x
Milestone

Comments

@pidehen23
Copy link

相关平台

微信小程序

复现仓库

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

复现步骤

image
image

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
@Chen-jj Chen-jj added A-typings Area - TypeScript Typings 相关 V-3 Version - 3.x labels Jul 7, 2020
@Chen-jj Chen-jj added this to the 3.0.3 milestone Jul 7, 2020
@0x3c
Copy link

0x3c commented Jul 7, 2020

在 @tarojs/runtime 包里, @tarojs/taro 包也是做了 re-export

Chen-jj added a commit that referenced this issue Jul 8, 2020
)

* fix: 修复getCurrentInstance方法类型声明#6904

* fix: 修复taro update project报错#6850

Co-authored-by: chenjiajian <798095202@qq.com>
@Chen-jj Chen-jj closed this as completed Jul 8, 2020
@zjg910723
Copy link

我也是按文档也没有找到,是否已经解决了问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-typings Area - TypeScript Typings 相关 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

5 participants