Hi All! Would anyone be able to help me understand the project folder structure created with Vite (React)? Specifically, why are there index.css and app.css? Both .css extensions? And what is the difference between main.js and index.jsx, both seem to target the root id from the index.html. Any learning sources would be appreciated. In the images attached I have a folder structure from Bob Ziroll's react course in Scrimba, the other one is created with Vite (React).
#Folder structure help.
8 messages · Page 1 of 1 (latest)
index.css is for styling main.jsx and App.css is for styling App.jsx
And there is no such major difference between index.js file in Bob Ziroll's screenshot and main.jsx in the Vite project. Just different names.
Haven't used vite but learned something new,
Also the coding and all is similar to cra?
yeah
Do we need to have to config something or just use the create vite command and we r good to go?
just use the command and you're good to go
Thank you for te reply. So the styling in React in general is kept in diffrent files? For example, would I create a separate styling files for every single component?
That's based on ur comfort,
If u have a Component like search feature,
U create search feature folder(optional), in that
Search.jsx
search.css
Link those those
with the above thing, u can search up for css errors or something easily.
Else,
U can also go for search.jsx, laughing.jsx, playing.jsx,... and a combined 1 css file for those.