Update Arrays Immutably
- If you have an array, we should not mutate or change it. Instead, we should give react a new array object.
//add
setTags[...tags, "new tag"];
//update
setTags(tags.map(tag => tag === "tag2" ? "tag2 updated": tag);
//remove
setTags(tags.filter(tag => tag !== "tag1");