Skip to content

How do I {...bind()} if I don't have access to the DOM in a react-three-fiber component? Can I provide an element? #313

Answered by dbismut
yuchant asked this question in Q&A
Discussion options

You must be logged in to vote

Not sure what you mean: you can pass {... bind()} to a r3f <mesh {...bind()} />, no problem.
The lib supports passing a ref but it needs to be an HTMLElement:

useDrag(handler, { target: yourRef })

Maybe if you describe your use case in more details it might be clearer.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@yuchant
Comment options

@dbismut
Comment options

Answer selected by yuchant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants