I'm retrieving the data from Firestore and then displaying it in a list with the following code:
{ docs && docs.map(doc => (
<ul key={doc.id}>
<li>
<button>
<Link to={`/tag/${doc.myTag}`}>
{doc.myTag}
</Link>
</button>
</li>
</ul>
))}
This outputs every tag. At first I want array of data fetched from Firestore and set into my own new array. After that, I would like to remove duplicates and show just unique tags. What would be the correct way to do this?
I'm thinking to create a new array and then use filter + indexOf, or something similar, but I need to create an array of all the tags first, which is where I'm having the problem.
Any help very much appreciated.