0.2.1 • Published 6 years ago

@isaac.js/create-react-component-ts v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

create-react-component-ts

use @isaac.js/create-react-component instead!

use @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

Usage

  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

MyComponent

  - MyComponent.tsx

  - MyComponent.scss

  - index.ts

Template

Template for Component.scss

@charset 'utf-8';
.__REPLACE__ {

}

Template for Component.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 (
      <div className={cStyle.__REPLACE__}>__REPLACE__</div>
    )
  }
}

Template for index.ts

import { __REPLACE__ } from './__REPLACE__'
export default __REPLACE__
0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

1.0.0

6 years ago