-
-
Save tdeekens/def88616c4995569c45f55aecb64c511 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const RadioGroup = props => | |
React.Children.map(props.children, child => { | |
if (child.type === RadioOption) | |
return React.cloneElement(child, { | |
isChecked: props.value === child.props.value, | |
name: props.name, | |
onChange: props.handleChange | |
}); | |
return child; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment