Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: React 19 support #2349

Draft
wants to merge 4 commits into
base: next
Choose a base branch
from

Conversation

CodyJasonBennett
Copy link
Member

@CodyJasonBennett CodyJasonBennett commented Jan 2, 2025

Why

Adds support for React 19 and R3F v9.

What

Upstream breaking changes are limited to types, and I opt to remove deprecated patterns where able:

  • MutableRefObject<T> -> RefObject<T>
  • useRef<T>() -> useRef<T>(null)
  • (ambient) JSX -> React.JSX
  • PropsWithRef<T> -> T
  • (R3F) JSX.IntrinsicElements -> ThreeElements (see review comment)

Checklist

  • Documentation updated
  • Demo added
  • Ready to be merged

Copy link

changeset-bot bot commented Jan 2, 2025

⚠️ No Changeset found

Latest commit: a3bd26d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jan 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
react-spring ❌ Failed (Inspect) Jan 2, 2025 9:45am

Comment on lines 21 to 23
const host = createHost(primitives, {
// @ts-expect-error r3f related
applyAnimatedValues: applyProps,
})
Copy link
Member Author

Choose a reason for hiding this comment

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

This should probably be a proxy since it is valid to extend the JSX interface beyond what the THREE namespace contains.

@CodyJasonBennett CodyJasonBennett linked an issue Jan 2, 2025 that may be closed by this pull request
5 tasks
This used to be pulled in by R3F, but we vendor it upstream as of late. Even though we intend to later migrate changes, it's best to not depend on transient dependencies.
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.

React 19 support
1 participant