Giter VIP home page Giter VIP logo

react.makereactcomponentskeleton's Introduction

makeReactComponentSkeleton

makeReactComponentSkeleton is simple function that make react component skeleton

install

$ npm install -g make-react-component-skeleton

usage

 Usage: mkcpnt [options]

  Options:

    -n, --name [name]        component name to be created. (default: ExampleComponent)
    -t, --type [type]        component type to be created. "class" or "function" (default: class)
    -p, --path [path]        path where component will be created. (default: ./)
    -j, --jstype [jstype]    component file extension to be created. (default: jsx)
    -c, --csstype [csstype]  style file extension to be created. (default: scss)
    -v, --version            output the version number
    -S, --single             if include this, only component is made
    -h, --help               output usage information

example

basic example

$ mkcpnt -n Input
  • Structure of the created directory
Input
|-- Input.jsx
|-- Input.scss
|-- index.js
  • jsx -- class type
import React from 'react';
import PropTypes from 'prop-types';
import styles from './Input.scss';

class Input extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
    };
  }
  render() {
    return (
    );
  }
}

Input.propTypes = {
};
Input.defaultProps = {
};

export default Input;
  • index
import Input from './Input';

export default Input;

function example

$ mkcpnt -n Input -t function

Structure of the created directory is same

  • jsx -- function type
import React from 'react';
import PropTypes from 'prop-types';
import styles from './Input.scss';

const Input = props => {
  return (
  );
}

Input.propTypes = {
};
Input.defaultProps = {
};

export default Input;

file extension example

$ mkcpnt -n Input -j js -c css
  • result
Input
|-- Input.js
|-- Input.css
|-- index.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.