Source code

The src directory created by create-react-app is the most important part of your application. This is where any React components you create will live. Out of the box, this directory has some source files in it to get you on your way, though you'll obviously replace the majority of them as you move forward. Here's what you'll find by default:

  • App.css: This defines some simple CSS to style the App component
  • App.js: This is the default component that renders the application HTML
  • App.test.js: This is a basic test for the App component
  • index.css: This defines application-wide styles
  • index.js: This is the entry point into your application—renders the App component
  • logo.svg: An animated React logo that's rendered by the App component
  • registerServiceWorker.js: In production builds, this enables loading components from an offline cache

There are two benefits to having these default source files created for you. First, you can quickly start the application to make sure everything is working and that you didn't make any basic mistakes. Second, it sets a basic pattern for you to follow with your components. Throughout this book, you'll see how applying patterns to components actually aids with tooling.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.128.129