Merge pull request #64 from iamdidev/patch-1

Replace `map` with `forEach`
This commit is contained in:
Angelos Chalaris
2019-06-24 08:37:35 +03:00
committed by GitHub

View File

@ -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]);