Last active
October 11, 2021 11:27
-
-
Save yarigpopov/36357882490f0be6001f6d17d82fdf73 to your computer and use it in GitHub Desktop.
RadioImageForm.render() и RadioImageForm.RadioInput
This file contains hidden or 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
export class RadioImageForm extends React.Component<Probs, State> { | |
// ... | |
render(): React.ReactElement { | |
const { currentValue, onChange, defaultValue } = this.state; | |
return ( | |
<RadioImageFormWrapper> | |
<form> | |
{ | |
React.Children.map(this.props.children, | |
(child: React.ReactElement) => | |
React.cloneElement(child, { | |
currentValue, | |
onChange, | |
defaultValue, | |
}), | |
) | |
} | |
</form> | |
</RadioImageFormWrapper> | |
) | |
} | |
// ... | |
} |
This file contains hidden or 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
export class RadioImageForm extends React.Component<Probs, State> { | |
// ... | |
render(): React.ReactElement { | |
const { currentValue, onChange, defaultValue } = this.state; | |
return ( | |
<RadioImageFormWrapper> | |
<form> | |
{ | |
React.Children.map(this.props.children, | |
(child: React.ReactElement) => | |
React.cloneElement(child, { | |
currentValue, | |
onChange, | |
defaultValue, | |
}), | |
) | |
} | |
</form> | |
</RadioImageFormWrapper> | |
) | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment