How to change the background color of certain routes/pages?
Unanswered
Sun bear posted this in #help-forum
Sun bearOP
I am using the page router. Let's say I want the color of my
/books route to be grey, but the rest should be white - Is there a way without using hooks like useRouter? I want the page to be pre-generated with the correct background colour already on the server, but I can only find a solution to change the color after the intial load. Am I doing something wrong?3 Replies
@Sun bear I am using the page router. Let's say I want the color of my `/books` route to be grey, but the rest should be white - Is there a way without using hooks like useRouter? I want the page to be pre-generated with the correct background colour already on the server, but I can only find a solution to change the color after the intial load. Am I doing something wrong?
useRouter with pathname should prerender on the server just fine
use it inside
_app.jsor inside the component that you want to colour