From 507f80796a98a11ee2aee564f2cb9fdcd2258078 Mon Sep 17 00:00:00 2001 From: "Tom.Huang" Date: Fri, 28 Jun 2019 09:59:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(rn):=20=E5=AF=BC=E5=87=BA=20hooks=20?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=BB=A5=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=20RN=20=E7=AB=AF=E6=8E=A5=E5=8F=A3=E6=9C=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-rn/src/index.ts | 36 +++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/packages/taro-rn/src/index.ts b/packages/taro-rn/src/index.ts index dedb36604ddf..632b4217f666 100644 --- a/packages/taro-rn/src/index.ts +++ b/packages/taro-rn/src/index.ts @@ -12,6 +12,20 @@ import { import initNativeApi from './native-api' import { Component, PureComponent } from './component' +import { + createContext, + useState, + useEffect, + useReducer, + useCallback, + useMemo, + useRef, + useLayoutEffect, + useContext +} from 'react' + +import { permanentlyNotSupport } from '../api/utils' + const Taro = { getEnv, ENV_TYPE, @@ -22,7 +36,16 @@ const Taro = { internal_safe_get, internal_safe_set, Component, - PureComponent + PureComponent, + createContext, + useState, + useEffect, + useReducer, + useCallback, + useMemo, + useRef, + useLayoutEffect, + useContext } export { @@ -35,7 +58,16 @@ export { internal_safe_get, internal_safe_set, Component, - PureComponent + PureComponent, + createContext, + useState, + useEffect, + useReducer, + useCallback, + useMemo, + useRef, + useLayoutEffect, + useContext } initNativeApi(Taro)