Skip to content

Commit

Permalink
Add docs for React hooks (#14425)
Browse files Browse the repository at this point in the history
  • Loading branch information
nosolosw authored and youknowriad committed Mar 20, 2019
1 parent 6692179 commit 381b1c0
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 23 deletions.
40 changes: 30 additions & 10 deletions packages/element/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,61 +318,81 @@ Removes any mounted element from the target DOM node.

[src/index.js#L1-L1](src/index.js#L1-L1)

Make React Hooks available
**Related**

- <https://reactjs.org/docs/hooks-reference.html#usecallback>

### useContext

[src/index.js#L1-L1](src/index.js#L1-L1)

Make React Hooks available
**Related**

- <https://reactjs.org/docs/hooks-reference.html#usecontext>

### useDebugValue

[src/index.js#L1-L1](src/index.js#L1-L1)

Make React Hooks available
**Related**

- <https://reactjs.org/docs/hooks-reference.html#usedebugvalue>

### useEffect

[src/index.js#L1-L1](src/index.js#L1-L1)

Make React Hooks available
**Related**

- <https://reactjs.org/docs/hooks-reference.html#useeffect>

### useImperativeHandle

[src/index.js#L1-L1](src/index.js#L1-L1)

Make React Hooks available
**Related**

- <https://reactjs.org/docs/hooks-reference.html#useimperativehandle>

### useLayoutEffect

[src/index.js#L1-L1](src/index.js#L1-L1)

Make React Hooks available
**Related**

- <https://reactjs.org/docs/hooks-reference.html#uselayouteffect>

### useMemo

[src/index.js#L1-L1](src/index.js#L1-L1)

Make React Hooks available
**Related**

- <https://reactjs.org/docs/hooks-reference.html#usememo>

### useReducer

[src/index.js#L1-L1](src/index.js#L1-L1)

Make React Hooks available
**Related**

- <https://reactjs.org/docs/hooks-reference.html#usereducer>

### useRef

[src/index.js#L1-L1](src/index.js#L1-L1)

Make React Hooks available
**Related**

- <https://reactjs.org/docs/hooks-reference.html#useref>

### useState

[src/index.js#L1-L1](src/index.js#L1-L1)

Make React Hooks available
**Related**

- <https://reactjs.org/docs/hooks-reference.html#usestate>


<!-- END TOKEN(Autogenerated API docs) -->
Expand Down
60 changes: 47 additions & 13 deletions packages/element/src/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,54 @@ export { isValidElement };
export { StrictMode };

/**
* Make React Hooks available
* @see https://reactjs.org/docs/hooks-reference.html#usecallback
*/
export {
useCallback,
useContext,
useDebugValue,
useEffect,
useImperativeHandle,
useLayoutEffect,
useMemo,
useReducer,
useRef,
useState,
};
export { useCallback };

/**
* @see https://reactjs.org/docs/hooks-reference.html#usecontext
*/
export { useContext };

/**
* @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue
*/
export { useDebugValue };

/**
* @see https://reactjs.org/docs/hooks-reference.html#useeffect
*/
export { useEffect };

/**
* @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle
*/
export { useImperativeHandle };

/**
* @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect
*/
export { useLayoutEffect };

/**
* @see https://reactjs.org/docs/hooks-reference.html#usememo
*/
export { useMemo };

/**
* @see https://reactjs.org/docs/hooks-reference.html#usereducer
*/
export { useReducer };

/**
* @see https://reactjs.org/docs/hooks-reference.html#useref
*/
export { useRef };

/**
* @see https://reactjs.org/docs/hooks-reference.html#usestate
*/
export { useState };

/**
* Concatenate two or more React children objects.
Expand Down

0 comments on commit 381b1c0

Please sign in to comment.