File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff 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
2022const 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 *
You can’t perform that action at this time.
0 commit comments