This is a standard working checkbox:
const [myValue1, setMyValue1] = React.useState(true);
<InputCheckbox
label="Registry"
value={myValue1}
onChange={(value, name) => {
setMyValue1(value);
console.log(`${name}:${value}`);}}
/>
Now I create a lot of checkboxes like this:
{someTools.map(({ title }) => (
<>
<InputCheckbox
label={title}
value={false} <- Current Placeholder
onChange={(value, name) => { ...? }}
/>
))}
As you can see, in the current state, I can not check or uncheck my checkboxes because I am missing the const [myValue / setMyValue1] for every checkbox in my .map function.
How can I dynamically create those variables and use them in my onChange function?