I have an Checkbox input in React Bootstrap.
if my Variable isTrue=true I want to set checked to my input.
I'm adding checked ={isTrue ? true : false} to the input, but after I do this, I'm unable to uncheck it. (I have this input in a loop)
<input type='checkbox' checked ={isTrue ? true : false} />
When I do this:
<input type="checkbox" {checked ? 'checked' : ''} name="example" />
I get error: "Spread types may only be created from object types.ts(2698)"
How can I conditionally set checked to a checkbox input?