react-init-class

1.0.7 • Public • Published

react-init-class

A Simple npm module to create a react init class with a default constructor and render methods. It will create a class with the file name provided by -f <className (or) fileName> parameter and in the path provided by -p </path/to/dir> parameter.

You can install the module by runnning:

npm install react-init-class

Usage:

You can use the module by running: react-init-class -f <fileName/className> -p </path/to/dir>

Eg: react-init-class -f SampleComponent -p '~/Desktop/Test'

This will create a SampleComponent.js file in ~/Desktop/Test/SampleComponent.js.

SampleComponent.js file will be created as below:

import React, { Component as ReactComponent } from 'react';

class SampleComponent extends ReactComponent {
    constructor(props) {
        super(props);
        this.state = {};
    }

    render() {
        return (
            <div></div>
        );
    }
}

export default SampleComponent;

Package Sidebar

Install

npm i react-init-class

Weekly Downloads

0

Version

1.0.7

License

MIT

Unpacked Size

3.45 kB

Total Files

5

Last publish

Collaborators

  • divakardass