Giter VIP home page Giter VIP logo

generator-react-stuff's Introduction

generator-react-stuff NPM version Build Status Dependency Status

Generates some react component and other stuff.

This is a tool to generate react component skeletons.

It can generate stateless function components, es6 class components, and components that are connected to Redux store.

The format is pretty specific to a particular project I work on. Please submit an issue if you actually use this and want to be able to configure file extensions and whatnot.

Installation

First, install Yeoman and generator-react-stuff. If you are unfamiliar with Yeoman, have a read.

# or npm
yarn install -g yo
yarn install -g generator-react-stuff

Set up

To perform set up (required), run in the root of your project:

yo react-stuff

You'll be asked a couple of questions to determine where files should be placed within your project.

  • Component root
  • Whether you want to extend class style components from Component or PureComponent

Please note that this will create a .yo-rc.json in your project root. Add this to your gitignore if you need to.

Usage

Please run commands in the root of your project.

Generate a component

yo react-stuff:component

Options:

  • Name
  • Stateless function vs class
  • CSS file
  • Additional path to where the component folder should be placed

E.g. if your component root was set up as ./src/components, and you specify additional path of pages, the new component folder will be ./src/components/pages/MyComponent

Output:

MyComponent/
  MyComponent.jsx
  MyComponent.css

Generate a 'container' component (i.e. connected to a redux store)

yo react-stuff:container

Options:

  • Name
  • CSS file
  • Additional path to where the component folder should be placed

License

MIT © Tyler Crammond

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.