Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Feb 21, 2020
1 parent c924b2a commit ff52b56
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ import {
Provider,
createElement,
createContext as createContextOrig,
// @ts-ignore
createMutableSource,
memo,
useCallback,
useContext as useContextOrig,
useMemo,
// @ts-ignore
useMutableSource,
useRef,
} from 'react';

const createMutableSource = 'NOT_AVAILABLE_YET' as any;
const useMutableSource = 'NOT_AVAILABLE_YET' as any;

const SOURCE_SYMBOL = Symbol();

Expand Down Expand Up @@ -75,8 +77,8 @@ export function useContext<Value, Selected>(
*
* It will only accept context created by `createContext`.
* It will trigger re-render if only the selected value is referentially changed.
* The selector should be stable for better performance.
* Either define selector outside render or use `useCallback`.
* The selector must be stable.
* Either define selector outside render or wrap with `useCallback`.
*
* The selector should return referentially equal result for same input for better performance.
*
Expand Down

0 comments on commit ff52b56

Please sign in to comment.