G
G
Gimir2020-02-07 18:12:51
Layout
Gimir, 2020-02-07 18:12:51

Is it possible to make a grid in the root (pre-root) App.js component in React?

5e3d7d729b1a2028587031.png
Good evening, here is the screenshot of the code. On the left in the editor, as you can see, the App.js component and the css file for it are open.
Question: is it possible (isn't it considered bad practice) to make the application grid like this in the main component, and add other components styled with styled-components to the divs? It’s just that apart from the header, sidebar and content, I don’t have anything else, and other pages too.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
camelCaseVlad, 2020-02-07
@Gimir

Leave only global styles* in App.css.
div1 and div2 are separate, isolated components, so their classes will be imported in their respective files.
*this approach will not be bad practice, on the contrary, it is the right approach. One has only to look at the App.css file in create-react-app where you will find the global styles for the app.
5e3d813c04d0a147872429.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question