Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions packages/core/src/hooks/useTransition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
// Return a `SpringRef` if a deps array was passed.
const ref = useMemo(
() => (propsFn || arguments.length == 3 ? SpringRef() : void 0),
[]

Check warning on line 94 in packages/core/src/hooks/useTransition.tsx

View workflow job for this annotation

GitHub Actions / Style Checks

React Hook useMemo has a missing dependency: 'propsFn'. Either include it or remove the dependency array
)

// Every item has its own transition.
Expand Down Expand Up @@ -432,15 +432,17 @@
{transitions.map((t, i) => {
const { springs } = changes.get(t) || t.ctrl
const elem: any = render({ ...springs }, t.item, t, i)
return elem && elem.type ? (
<elem.type
{...elem.props}
key={is.str(t.key) || is.num(t.key) ? t.key : t.ctrl.id}
ref={elem.ref}
/>
) : (
elem
)

const key = is.str(t.key) || is.num(t.key) ? t.key : t.ctrl.id
const isLegacyReact = React.version < '19.0.0'

const props = elem?.props ?? {}

if (isLegacyReact) {
props.ref = elem.ref
}

return elem && elem.type ? <elem.type key={key} {...props} /> : elem
})}
</>
)
Expand Down
Loading