Skip to content

Commit 8422a0e

Browse files
author
Loïc Mangeonjean
committed
fix: fix build
1 parent 88f1a0d commit 8422a0e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/hooks.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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

4445
export 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
}

0 commit comments

Comments
 (0)