File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 2525 "types" : " ./index.d.ts" ,
2626 "dependencies" : {
2727 "@react-devui/utils" : " file:../utils" ,
28- "immer" : " ^9.0.16" ,
2928 "lodash" : " ^4.17.21" ,
3029 "rxjs" : " ^7.6.0"
3130 },
3231 "peerDependencies" : {
32+ "immer" : " >=2.0.0" ,
3333 "react" : " ^18.2.0" ,
3434 "react-dom" : " ^18.2.0"
3535 },
Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ export type ImmerHook<S> = [S, Updater<S>];
1010export function useImmer < S > ( ) : ImmerHook < S | undefined > ;
1111export function useImmer < S = any > ( initialValue : S | ( ( ) => S ) ) : ImmerHook < S > ;
1212export function useImmer ( initialValue ?: any ) {
13- const [ val , updateValue ] = useState ( ( ) => freeze ( typeof initialValue === 'function' ? initialValue ( ) : initialValue , true ) ) ;
13+ const [ value , updateValue ] = useState ( ( ) => freeze ( typeof initialValue === 'function' ? initialValue ( ) : initialValue , true ) ) ;
1414 const setValue = useCallback ( ( updater : any ) => {
1515 if ( typeof updater === 'function' ) updateValue ( produce ( updater ) ) ;
1616 else updateValue ( freeze ( updater ) ) ;
1717 } , [ ] ) ;
18- return [ val , setValue ] ;
18+ return [ value , setValue ] ;
1919}
Original file line number Diff line number Diff line change 2727 "@react-devui/hooks" : " file:../hooks" ,
2828 "@react-devui/icons" : " file:../icons" ,
2929 "@react-devui/utils" : " file:../utils" ,
30- "immer" : " ^9.0.16" ,
3130 "lodash" : " ^4.17.21" ,
3231 "rfs" : " ^9.0.6" ,
3332 "rxjs" : " ^7.6.0"
3433 },
3534 "peerDependencies" : {
3635 "dayjs" : " ^1.11.7" ,
36+ "immer" : " >=2.0.0" ,
3737 "react" : " ^18.2.0" ,
3838 "react-dom" : " ^18.2.0"
3939 },
You can’t perform that action at this time.
0 commit comments