I have a function onTagSelected() that updates now a single value for a key inside a object:
const NotesContainer = ({ }) => { const [notesDummyData, setNo
spread the previous tag and add selectedTag to end
just change this
return { ...x, tag: selectedTag };
to
return { ...x, tag: [...x.tag, selectedTag] };
Or
return { ...x, tag: x.tag.concat(selectedTag) };