CRA-TEMPLATE
A initial template to React projects using Create React App
Installing
-
Use this template with the cra command
Using npm:
$ npx create-react-app my-app --template @jrantunes/cra-template
Using yarn:
$ yarn create react-app my-app --template @jrantunes/cra-template
-
Run the prepare script to setup husky pre-commit
Using npm:
$ npm run prepare
Using yarn:
$ yarn prepare
Lint-staged is configured to run the linting(with --max-warnings=0) and test scripts if one of these two fails the changes wont be commited
-
Start your app
Using npm:
$ npm run start
Using yarn:
$ yarn start
-
To automatically create your component folder you can use the generate script
Using npm:
$ npm run generate ComponentName
Using yarn:
$ yarn generate ComponentName
The generated folder will contain the following files:
-
index.tsx -
The component file
-
{{ component_name }}.spec.tsx -
The tests of the component
-
stories.tsx -
The stories of the component
-
styles.ts -
The styles of the component
-