Let's say there is a website with routes: /routeA, /routeB ... /routeZ
Each of those routes render a ComponentA, ComponentB ... ComponentZ
How to run a particular piece of code no matter which route has been reached?
The piece of code is irrelevant. It could be console.log("Awesome stackoverflow")
Obviously, in each component I could call useEffect and call the piece of code there. However, this is repetitive since I would have to write Z useEffect for the Z components we have. Instead, I am looking for a way to execute the piece of code without needing to repeate code through all components.