Best way to create new React component using create-react-app

You may use directly without installing the generate-react-cli

npx generate-react-cli component MyComponent

Which will install a component based on your project preferences (ex: typescript, scss, etc..).

A file called generate-react-cli.json will be created where all the settings will be stored for future use.


Another way is to create files manually and use snippets to generate the code.

For example, take a look at this JavaScript/React VS Code extension. You can also create your own snippets or find other extensions if you were interested.