I'm new to react and want to create a crypto price tracker using coingecko api. I fetched the data and displayed it correctly but it don't update on it's own. When I reload the page then the data is updated. So, I used this code I found on internet
<meta http-equiv="refresh" content="30">
This code works fine but the user experience is so bad with this.
Is there any way I can fix it. I want it to work just like we usually see in crypto exchange app.
Not sure the API you mentioned is REST API or WEB SOCKET API. If it is Web Socket API, you would receive the update data from the server, and you just need to update your web components.
Otherwise, you might need to use the JavaScript setTimeInterval to keep call API for every 30seconds(example).