Bootstrap a new React project with npx and create-react-app

Share this video with your friends

Send Tweet

Getting started with a new frontend project can be daunting. Sometimes, configuring Babel, webpack, eslint, Jest and all the other tools common to most frontend applications, just holds you back from building something. The React team has built and maintains create-react-app so you can start a project quickly without having to worry about setting up all the tooling. You get everything pre-configured with a lot of really sensible defaults. In this lesson, we'll bootstrap a project with npx and create-react-app so we can get right into building apps with React.

Zoran Stankovic
Zoran Stankovic
~ 5 years ago

Hi Andy, I watched your course completely and I think it's great. But I have one question. I noticed that for components export you are not using default. Is there a reason for that or just a personal preference?

Andy Van Slaars
Andy Van Slaars(instructor)
~ 5 years ago

Hi Andy, I watched your course completely and I think it's great. But I have one question. I noticed that for components export you are not using default. Is there a reason for that or just a personal preference?

It's largely preference. I like to know that naming will be consistent across the project. While you can alias the imports, the named exports make it far more likely that components will be exported and imported using consistent naming. You can also have multiple named exports from a single module (think an index.js file in a directory that imports and re-exports all the components), you can get nice hints in VSCode via the TypeScript language server.