const { data: cryptoList, isFetching } = useGetCryptosQuery(count);
const [cryptos, setCryptos] = useState([]);
const [searchTerm, setSearchTerm] = useState("");
useEffect(() => {
setCryptos(cryptoList?.data?.coins);
const filteredData = cryptoList?.data?.coins.filter((coin) =>
coin.name.toLowerCase().includes(searchTerm.toLowerCase())
);
setCryptos(filteredData);
}, [cryptoList, searchTerm]);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter