30 seconds of ReactBack to Home
Renders a checkbox list that uses a callback function to pass its selected value/values to the parent component.
React.setState()to create a
datastate variable and set its initial value equal to the
- Create a function
togglethat is used to toggle the
checkedto update the
datastate variable and call the
onChangecallback passed via the component's props.
- Render a
<ul>element and use
Array.prototype.map()to map the
datastate variable to individual
<input>elements as their children.
<input>element has the
type='checkbox'attribute and is marked as
readOnly, as its click events are handled by the parent