In the
RadioGroupcomponent, when cloning eachchildelement (RadioOption), what’s the condition that determines the value of the newcheckedprop that gets merged into the existing props of eachRadioOptioncomponent? Recall that theRadioGroupcomponent has three props -onChange,selectedandchildren- and that eachRadioOptioncomponent receives two props -valueandchildren.React.cloneElement(child, { onChange, checked: child.props.value === selected, });React.cloneElement(child, { onChange, checked: child.checked === true, });React.cloneElement(child, { onChange, checked: child.props.selected, });
Inside the
RadioOptioncomponent, what should be the value of theonChangeprop from theradioinput element? Recall that theRadioOptioncomponent receives four props -value, checked, onChangeandchildren.<input type="radio" onChange={e => onChange(e.target.value)} /><input type="radio" onChange={props.onChange} /><input type="radio" onChange={props.onChange} />
What are the arguments that the
React.Children.mapfunction receives?The first argument is the children prop, and there is no second argument.
The first argument is the children prop, and the second argument is a transformation function that returns a new React element.
The first argument is the children prop, and the second argument is a predicate function that returns a boolean.

