G
G
gallantalex2017-09-28 18:49:02
css
gallantalex, 2017-09-28 18:49:02

How to set different css properties for different pages in React?

How to set different css properties on separate pages in React?
For example, the Home page should look like this:

body {
background: white;
}

And on the About page like this:
body {
background: blue;
}

Since these are different routes, maybe it is worth starting from this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Gerasimov, 2017-09-28
@Omashu

Well, where do you render the body tag there and set modifiers depending on the route or other parameters.
Or like this:

<Layout bodyStyle={styles}>
<Component/>
</Layout>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question