@skr571999/create-react-componentdeprecated

Simple package for creating React component.

Usage no npm install needed!

<script type="module">
  import skr571999CreateReactComponent from 'https://cdn.skypack.dev/@skr571999/create-react-component';
</script>

README

Create React Component

Simple package for creating React component.

Installing

npm i -g @skr571999/create-react-component

or Running using npx(without Installing)

npx @skr571999/create-react-component -n ComponentName

Usage/Options

Usage: create-react-component -n <name>

Options:
      --help       Show help                                       [boolean]
      --version    Show version number                             [boolean]
  -n, --compName   Component name                        [string] [required]
  -l, --language   Language [js, ts(default)]                       [string]
  -c, --component  Make component [No(default)]                    [boolean]

Examples

  • For JavaScript
cd src
create-react-component -n TextBox -l js

# will create following component structure
src
├── components
    ├── TextBox
        ├── textbox.view.jsx
        └── index.js
  • For TypeScript
cd src
create-react-component -n TextBox

# will create following component structure
src
├── components
    ├── TextBox
        ├── textbox.view.tsx
        └── index.ts
  • For TypeScript with a .container.tsx file
cd src
create-react-component -n TextBox -c

# will create following component structure
src
├── components
    ├── TextBox
        ├── textbox.container.tsx
        ├── textbox.view.tsx
        └── index.ts