fix: fix useTransition when working with React 18#2396
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| const props = { ...elem?.props } | ||
|
|
||
| if (isLegacyReact) { | ||
| if (isLegacyReact && elem && elem.type) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
|
@romain-trotard this should be similar to my PR here #2394 which has a beta version. Would be create if you could verify it too and we can merge one of the 2 PRs |
|
@dimitris-tsetsonis I've just tested the |
Hello :)
Why
This is a PR to fix the issue that I've opened #2395
What
There are some problems after the change made here https://github.com/pmndrs/react-spring/pull/2373/files#diff-3dce88b788d6e5008705461509e6c3a027695ca9a198d918b9d9c4800d4d2181R441 when working with React 18
Checklist
ps: the command
yarn changeset:adddoes not seem to work. It seemsyarn changesetadds the changeset file, should I add it? (I see that some PRs are merged without changeset file)