create react component template with typescript
npm install @isaac.js/create-react-component-ts@isaac.js/create-react-component instead!@isaac.js/create-react-component instead!see @isaac.js/create-react-component
save the trouble copy paste and rename when creating new react component with typescript
1. install: npm install -g @isaac.js/create-react-component-ts
2. use: create-react-component-ts MyComponent
this will generate a directory in the current working directory
``shell
MyComponent
- MyComponent.tsx
- MyComponent.scss
- index.ts
`
`scss
@charset 'utf-8';
.__REPLACE__ {
}
`
` tsx
import * as React from 'react'
import cStyle from './__REPLACE__.scss'
type __REPLACE__Props = {}
type __REPLACE__State = {}
export class __REPLACE__ extends React.Component<__REPLACE__Props, __REPLACE__State> {
public render() {
return (
`
`ts
import { __REPLACE__ } from './__REPLACE__'
export default __REPLACE__
``