Skip to content

Commit ff52b56

Browse files
committed
update docs
1 parent c924b2a commit ff52b56

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ import {
77
Provider,
88
createElement,
99
createContext as createContextOrig,
10+
// @ts-ignore
11+
createMutableSource,
1012
memo,
1113
useCallback,
1214
useContext as useContextOrig,
1315
useMemo,
16+
// @ts-ignore
17+
useMutableSource,
1418
useRef,
1519
} from 'react';
1620

17-
const createMutableSource = 'NOT_AVAILABLE_YET' as any;
18-
const useMutableSource = 'NOT_AVAILABLE_YET' as any;
1921

2022
const SOURCE_SYMBOL = Symbol();
2123

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

0 commit comments

Comments
 (0)