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

fix(rn): 导出 hooks 相关接口,以解决 RN 端接口未定义问题 #3579

Merged
merged 1 commit into from
Jun 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions packages/taro-rn/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 {
Expand All @@ -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)
Expand Down