Merge pull request #64 from iamdidev/patch-1
Replace `map` with `forEach`
This commit is contained in:
@ -23,7 +23,7 @@ function MultiselectCheckbox({ options, onChange }) {
|
||||
const [data, setData] = React.useState(options);
|
||||
|
||||
const toggle = item => {
|
||||
data.map((_, key) => {
|
||||
data.forEach((_, key) => {
|
||||
if (data[key].label === item.label) data[key].checked = !item.checked;
|
||||
});
|
||||
setData([...data]);
|
||||
|
||||
Reference in New Issue
Block a user