Skip to content

Conversation

liambickett
Copy link

Why

JSX moved from the global namespace to the React module. Use of global breaks internal type declarations.

Resolves #2358 and ensures compatibility with React 19.

What

  • Explicitly import JSX type from 'react' in JSX-related types (web, shared, three)
  • Fixes type-level issues with WithAnimated and component declarations
  • Fix useRef type errors on build
  • Backwards-compatible with React 18

Checklist

  • Documentation updated (Not applicable)
  • Demo added (Not applicable)
  • Ready to be merged

…ror (pmndrs#2358)

React 19 moved the JSX namespace from global scope to the React module. This updates type definitions to explicitly import the `JSX` type from 'react', resolving issues issues for consumers using React 19+.

Note: Backwards-compatible with React 18.
@liambickett liambickett changed the base branch from next to 1-feat-react-19 March 30, 2025 17:18
@liambickett
Copy link
Author

@kierancap Ngl, I haven't been a contributor before. Just found and fixed this locally, so thought I would try to help. If there is anything I can do to make your life or merging this easier please lmk!

@kierancap
Copy link
Collaborator

@kierancap Ngl, I haven't been a contributor before. Just found and fixed this locally, so thought I would try to help. If there is anything I can do to make your life or merging this easier please lmk!

Hey! I very much appreciate the work!

I would probably say in terms of tidiness, that my PR should be closed properly before we add any more bits to it.

I'll hopefully have time this week to look into working on my PR after Josh's comments.

If you keep your branch alive, you should be able to directly make a PR to the upstream react-spring repo once my PR is merged!

Again, thank you for the help, greatly appreciated :) I'll drop you a ping here once that PR is merged

@liambickett
Copy link
Author

@kierancap Sounds like a plan! Thanks for what you're doing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: Animated div typescript error regarding children prop
2 participants