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

useHelper RefObject (non-mutable) #1945

Closed
wants to merge 1 commit into from
Closed

Conversation

abernier
Copy link
Contributor

@abernier abernier commented May 1, 2024

Why

Passing a mutable ref={} makes TS complains, here in the story:

image

What

so, I've naively convert useHelper's 1st param object3D into a simple RefObject (rather a MutableRefObject)

before after
image image

Checklist

I'm really not sure, how "safe" this is / how required this ref was to be mutable...

  • Documentation updated (example)
  • Storybook entry added (example)
  • Ready to be merged

Copy link

vercel bot commented May 1, 2024

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

Name Status Preview Updated (UTC)
drei ✅ Ready (Inspect) Visit Preview May 1, 2024 9:11am

@abernier abernier requested a review from drcmda May 1, 2024 09:12
Copy link

codesandbox-ci bot commented May 1, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@abernier abernier marked this pull request as draft May 1, 2024 09:12
@CodyJasonBennett
Copy link
Member

This is actually what the React 19 types do since useRef can lead to confusing mutable/immutable types.

@abernier
Copy link
Contributor Author

abernier commented May 1, 2024

This is actually what the React 19 types do since useRef can lead to confusing mutable/immutable types.

IIUC, this PR is useless? (handled by next React19 updated types)

@CodyJasonBennett
Copy link
Member

Yes, this will be resolved by React 19 and the next major of both R3F/Drei. #1941

@abernier abernier closed this May 1, 2024
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.

None yet

2 participants