Ref either locally or passed via prop
I have a TextField that requires a ref to an input field.
So far so good.
But in case I have a parent component that also wants to ref the input, I am no longer sure how to handle it.
I have something like this
This works for outer ref, but breaks fallback inner ref. What is the correct way to handle this case? ❤️
3 Replies
GitHub
solid-primitives/README.md at main · solidjs-community/solid-primit...
A library of high-quality primitives that extend SolidJS reactivity. - solid-primitives/README.md at main · solidjs-community/solid-primitives
But if you want to do it manually, use a signal for the ref and wrap the setter so that it will also call props.ref?.(node).
Much appreciated. Thank you. I'll have a look at the primitive 🙂