I need to attach a onClick handler to a react-bootstrap CheckBox component that will pass the status (checked/unchecked) to the handler, so I can use this to modify the route.
I am having trouble finding a clear code example of setting up a function as a handler on the onClick for a CheckBox component and how to pass the CheckBox status to that function.
If you could direct me to a good example it would be helpful. Or if I'm just doing it "the hard way" direct me to an alternate approach that can achieve this.
<Checkbox onClick={e => handler(e.target.checked)} />
It's the same as if it were a normal React <checkbox>, anyway.
thanks
Most helpful comment