File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export function useThemeColor(color: string): string | undefined {
1616 } )
1717 // Since useEffect is asynchronous, the theme may have changed between the initialization of state and now
1818 // Let's update the state just in case
19+ // eslint-disable-next-line react-hooks/set-state-in-effect
1920 setColorValue ( getCurrentThemeColor ( color ) )
2021 return ( ) => {
2122 disposable . dispose ( )
@@ -43,6 +44,7 @@ export function useUserConfiguration(
4344
4445export function useLastValueRef < T > ( value : T ) : MutableRefObject < T > {
4546 const ref = useRef < T > ( value )
47+ // eslint-disable-next-line react-hooks/refs
4648 ref . current = value
4749 return ref
4850}
@@ -62,6 +64,7 @@ export function usePrevious<T>(value: T): T | undefined {
6264 useEffect ( ( ) => {
6365 ref . current = value
6466 } , [ value ] )
67+ // eslint-disable-next-line react-hooks/refs
6568 return ref . current
6669}
6770
@@ -71,9 +74,11 @@ export function useDeepMemo<T, D extends unknown[]>(
7174 isEqual : ( a : D , b : D ) => boolean = deepEqual
7275) : T {
7376 const ref = useRef < { deps : D ; value : T } > ( undefined )
77+ // eslint-disable-next-line react-hooks/refs
7478 if ( ref . current == null || ! isEqual ( deps , ref . current . deps ) ) {
7579 ref . current = { deps, value : memoFn ( ) }
7680 }
7781
82+ // eslint-disable-next-line react-hooks/refs
7883 return ref . current . value
7984}
You can’t perform that action at this time.
0 commit comments