I want to make checkbox mandatory field in react js.
I am new to reactjs but i have an idea that i should do it using length . Below is the code:
<CheckboxGroup name="zones" value={this.state.zones} onChange={this.handleCheckboxChange}>
{(Checkbox) => (
<>
{this.state.zones_to_render_to_render.map((zone, key) =>
<Col key={key} lg="10">
<label >
<Checkbox value={zone.zone_id} />{zone.zone_name}
</label>
</Col>
)}
</>
)}
</CheckboxGroup>
How to check using length?