Skip to content

Commit

Permalink
fix: add annotation for 18.3 immutable useRef
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett committed Jan 10, 2025
1 parent 51312c3 commit 59579e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/animated/src/withAnimated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const withAnimated = (Component: any, host: HostConfig) => {

const observerRef = useRef<PropsObserver>(null)
useIsomorphicLayoutEffect(() => {
// @ts-expect-error useRef immutable in 18.3 types
observerRef.current = observer

// Observe the latest dependencies.
Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/hooks/useMemoOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export function useMemoOne<T>(getResult: () => T, inputs?: any[]): T {
}

useEffect(() => {
// @ts-expect-error useRef immutable in 18.3 types
committed.current = cache
if (prevCache == initial) {
initial.inputs = initial.result = undefined
Expand Down

0 comments on commit 59579e2

Please sign in to comment.