1.0.2 • Published 4 years ago

schematics-react v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Schematics React

Build Status npm version npm

Schematics generators for React 🎊

Features

  • 📜 Generates boilerplate
  • 🎛️ Configurable
  • 🛠️ Supports JavaScript & TypeScirpt
  • 📦 Works with create-react-app
  • 📌 Follows best pratices

Installation

  • npm:

    npm install -g @angular-devkit/schematics-cli
    npm install --save-dev schematics-react
  • yarn:

    yarn global add @angular-devkit/schematics-cli
    yarn add -D schematics-react

Usage

schematics schematics-react:<generator name> <arguments>

Available generators

Component

Creates a React component.

Example:

schematics schematics-react:component /src/components/myComponent

with alias:

schematics schematics-react:c /src/components/myComponent

Parameters

TypeNameDescriptionDefault
required {string}nameThe name of the component.none
{string}pathThe path to create the componentnone
{string}styleextThe file extension to be used for style files'css'
{boolean}noSpecSpecifies if a spec file is generatedfalse
{boolean}subfolderFlag to indicate if a dir is createdfalse
{boolean}propTypesSpecifies if a propTypes usedfalse
{boolean}statefulSpecifies if a state usedfalse
{boolean}tsSpecifies whether to use TypeScriptfalse

Functional component

Creates a React component.

Example:

schematics schematics-react:functional-component /src/components/myComponent

with alias:

schematics schematics-react:fc /src/components/myComponent

Parameters

TypeNameDescriptionDefault
required {string}nameThe name of the component.none
{string}pathThe path to create the componentnone
{string}styleextThe file extension to be used for style files'css'
{boolean}noSpecSpecifies if a spec file is generatedfalse
{boolean}subfolderFlag to indicate if a dir is createdfalse
{boolean}propTypesSpecifies if a propTypes usedfalse
{boolean}tsSpecifies whether to use TypeScriptfalse