Hi,
I have a component that conditionally renders a <select> (desktop) or a dialog (mobile). It’s usually used under an existing <label>, and I pass the label’s id down to associate it with the control. With useSelect, it seems like getLabelProps assumes the hook owns the label.
What's the recommended way to use useSelect with an already-existing label? Should I pass a labelId and skip getLabelProps entirely, or is there a better pattern for this?
Thanks!
Hi,
I have a component that conditionally renders a
<select>(desktop) or a dialog (mobile). It’s usually used under an existing<label>, and I pass the label’s id down to associate it with the control. WithuseSelect, it seems likegetLabelPropsassumes the hook owns the label.What's the recommended way to use
useSelectwith an already-existing label? Should I pass alabelIdand skipgetLabelPropsentirely, or is there a better pattern for this?Thanks!