I tried to search here/Google/GitHub but I'm not even sure of how to look for this. No matter what words I use they will always show me results of how to implement HMR. But that's not my issue. I just want to print on the browser console when the React Fast Refresh (Hot Module Reload) refreshes so I know that it was updated.
Okay. After searching for something different, I managed to find exactly what I wanted.
Instead of looking for "how to print when hmr refreshes" I searched for "how to clear console when hmr refreshes" and I found this:
https://stackoverflow.com/a/53933757/12038349
if (module.hot) {
module.hot.accept() // you don't need this if you're using CRA
module.hot.addStatusHandler(status => {
if (status === 'prepare') console.clear()
})
}
Worked like a charm.