Solutionunvalidated

const tags = post.tags?.replace(/ /g, "").split(",") || []; — To Ensure that the `replace` and `split` function should performed when `post.tags` is defined. Outcome: `const tags = post.tags ? post.tags.replace(/ /g, "").split(",") : [];`.

b976fdce-20bd-4f03-b60e-a8cdc4663ecb

const tags = post.tags?.replace(/ /g, "").split(",") || []; — To Ensure that the replace and split function should performed when post.tags is defined. Outcome: const tags = post.tags ? post.tags.replace(/ /g, "").split(",") : [];.