Skip to content
Closed
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
4 changes: 2 additions & 2 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 @@ -436,9 +436,9 @@
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 ?? {}
const props = { ...elem?.props }

if (isLegacyReact) {
if (isLegacyReact && elem && elem.type) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but do you know why we also need to check elem.type? It seems to me that && elem should be enough. Am I missing something?
I know there’s already the same check earlier; but i do not understand why it is necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I think elem should be enough. But to be completely iso with the previous code I put elem.type.

Maybe someone knowing better the codebase can tell why there is the condition elem && elem.type a little further in the codebase

props.ref = elem.ref
}

Expand Down
Loading