Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Add another ref prop for Checkbox and Radio component #162

Open
ryanwang520 opened this issue Nov 19, 2019 · 0 comments
Open

Add another ref prop for Checkbox and Radio component #162

ryanwang520 opened this issue Nov 19, 2019 · 0 comments

Comments

@ryanwang520
Copy link

馃殌 Feature Proposal

Checkbox and Radio components provide some way to access the underlying input element.

Motivation

Sometimes it's handy to access the input element directly(Such as integrate with react-hook-form), while the Checkbox and Radio components both only accept the ref prop which let us access the wrapping div element.

Example

<label>
    <Checkbox name="checkbox" ref={ref}  /> check me
</label>
//  ref does not refer to the actual `input` element, maybe add `innerRef` prop? 
<Checkbox name="checkbox" ref={ref} innerRef={checkboxInputRef}  />
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant