A NPM Package use to generate react typescript components using plop.
npx create-component-react-ts component TodoTable
npx create-component-react-ts layout AdminLayout
npx create-component-react-ts page TodoPage
npx create-component-react-ts context Todo
npx create-component-react-ts hook Todo
npx create-component-react-ts service ApiTodo
npx create-component-react-ts utils Storage
npm i create-component-react-ts
# or
npm install --save create-component-react-ts
npm install --global create-component-react-ts
yarn add create-component-react-ts
yarn global add create-component-react-ts
Add ./node_modules/.bin/create-component-react-ts to package.json scripts also can alias to short name
{
"scripts": {
"create-component-react-ts": "./node_modules/.bin/create-component-react-ts",
"create-react": "./node_modules/.bin/create-component-react-ts"
}
}
npm run create-react component Example1
npm run create-component-react-ts component Example1
yarn create-react component Example1
yarn create-component-react-ts component Example1
Example
yarn create-component-react-ts component TodoTable
yarn create-component-react-ts layout AdminLayout
yarn create-component-react-ts page TodoPage
yarn create-component-react-ts context Todo
yarn create-component-react-ts hook Todo
yarn create-component-react-ts service ApiTodo
yarn create-component-react-ts utils Storage
NOTE: Required packages
npm install --save react-router-dom
npm install --save @testing-library/react-hooks
# or
yarn add react-router-dom
yarn add @testing-library/react-hooks