I am using trying to fetch an API and am using the react state hook.
I want to get rid of all the duplicates in the base Symbol so that there should only be one baseSymbol. However, I am struggling to figure out how to do that especially if I want to use react state hooks. There's a total of 100 items in the array, so there's different types of duplicates. I'm not really sure what to do when after I filter it out, how would I re-render it.
My code for receiving the API is
const URL = "https://api.coincap.io/v2/markets/";
const [cryptoOptions, setCryptoOptions] = useState([]);
useEffect(() => {
fetch(URL)
.then((res) => res.json())
.then((data) => {
setCryptoOptions(data.data);
});
}, []);
