Skip to content

Commit a903406

Browse files
committed
add version check
1 parent 2ba4d7d commit a903406

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/core/src/hooks/useTransition.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from 'react'
2+
import { version as reactVersion } from 'react/package.json'
23
import { useContext, useRef, useMemo } from 'react'
34
import { Lookup, OneOrMore, UnknownProps } from '@react-spring/types'
45
import {
@@ -436,6 +437,7 @@ export function useTransition(
436437
<elem.type
437438
{...elem.props}
438439
key={is.str(t.key) || is.num(t.key) ? t.key : t.ctrl.id}
440+
ref={reactVersion < '19.0.0' ? elem.ref : elem.props.ref}
439441
/>
440442
) : (
441443
elem

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"allowSyntheticDefaultImports": true,
2727
"esModuleInterop": true,
2828
"skipLibCheck": true,
29-
"strictNullChecks": true
29+
"strictNullChecks": true,
30+
"resolveJsonModule": true
3031
}
3132
}

0 commit comments

Comments
 (0)