You could use Session Storage in the browser like this
if(!sessionStorage.active || sessionStorage.active == window.location.href) {
// First visit or refresh
} else {
// Render component
}
sessionStorage.active = window.location.href;
When the user first visits the page, sessionStorage.active will not be set and it will go to // First visit or refresh.
If the user refreshes the page, sessionStorage.active will be set but it will also equal the current url and go to // First visit or refresh.
If the user visits the page from another page within the site, sessionStorage.active will be set and it won't match window.location.href since it's currently set to the previous visited pages url. Therefore it will go to // Render component.
There might be some quirks with this solution that has to be solved for special use cases, but hopefully you have a good starting point.