snowden-fu / create-new-react-component

npm utility for creating react component

Home Page:https://www.npmjs.com/package/create-new-react-component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

create-new-react-component

A command-line interface (CLI) tool to quickly generate React components with optional TypeScript support and CSS styles.

Installation

npm install create-new-react-component --save-dev

Usage

create-new-react-component <componentName> [options]

Options

  • --withStyles: Create a CSS file for the component
  • --lang <style>: Choose the file style (js or ts), default is js

Examples

# Create a JavaScript component without styles
create-new-react-component MyComponent

# Create a JavaScript component with styles
create-new-react-component MyComponent --withStyles

# Create a TypeScript component without styles
create-new-react-component MyComponent --lang ts

# Create a TypeScript component with styles
create-new-react-component MyComponent --withStyles --lang ts

References

About

npm utility for creating react component

https://www.npmjs.com/package/create-new-react-component


Languages

Language:JavaScript 100.0%