2.0.4 • Published 3 years ago

react-sponge v2.0.4

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

react-sponge (rsg)

react-sponge can generate component skeleton. It will generate components in src folder of your project.

How to use

Installation

% npm i -g react-sponge

Get help

% rsg help                      display help for rsg 
% rsg help g                    display help for rsg generate

rsg command

rsg g <type> <name> [-p] 

Examples :

  1. Create class component
% rsg g c components/dropdown-menu/DropdownMenu

This code will generate the following folder structure and react class component.

your project

    - src
      - components
        - dropdown-menu
          - DropdownMenu.js
          - DropdownMenu.css

Here is how DropdownMenu.js looks like.

import React, {Component} from "react";
import "./DropdownMenu.css";

class DropdownMenu extends Component {
    constructor(props) {

        super(props);

        this.state = {

        };

    }

    render() {
        return (
          <>

          </>
        )}
    }
export default DropdownMenu;
  1. Create functional component
% rsg g f ShoppingList -p scss

This code will generate the following folder structure and react functional component.

your project

    - src
      - ShoppingList.js
      - ShoppingList.scss

Here is how ShoppingList.js looks like.

import React from "react";
import "./ShoppingList.scss";

const ShoppingList = () => (
   <>

   </>
)

export default ShoppingList;

License

MIT

2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago