Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Luke MarkhamFront End Web Development Techdegree Graduate 17,289 Points
Importing CSS into a J.S file
I'm just curious what is happening here? The CSS is not linked in index.html.
So I believe it's included in the mounting done in the
Is it somehow complied by React-app? if so what's it compiled into ? How can the browser know its CSS when its in a JS file ?
Tashan DuncanFront End Web Development Techdegree Graduate 17,799 Points
the compiling of the CSS is handled via Webpack which was installed with 'create-react-app'.
More information here: https://create-react-app.dev/docs/adding-a-stylesheet
Had the same hiccup with CSS, give this a try:
1) Downloading the files in the "Downloads" section of the video after running npx create-react-app my-app 2) Open scoreboards inside of the recently created React edition of scoreboards. 3) Replace src folder with the one provided in the "Downloads" section (it'll have a component folder) 4) Optional: if preferring the code from React Basics in app.js, copy and paste it in to update