Skip to content

Using external label instead of getLabelProps #1682

@functasti

Description

@functasti

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions