Created by: diegohaz
Related to #2482 (closed), #1242 (closed) and #1886
Generating new Component
Instead of creating component files by hand, you can use generact
to generate new components based on existing ones.
Optionally, you can add it to devDependencies
(yarn add --dev generact
) and add an npm script to easily generate new components based on another specific one (e.g. src/components/MySimpleBaseComponent/MySimpleBaseComponent.js
):
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
+ "component": "generact src/components/MySimpleBaseComponent/MySimpleBaseComponent.js"
}
Then, just run yarn component
.