node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org »

eve-react-templates

EVerify React Templates Generator

An easy and simple to use template generator for React applications.

First Steps

Ensure Node is installed.

Install Plop globally using $ npm install -g plop

Plop is a JavaScript template generator library which powers eve-react-templates

Using eve-react-templates in your project

Install the package:

$ npm install eve-react-templates

Create in the root of your project a plopfile.js with this content:

module.exports = require('eve-react-templates');

Add to your package.json scripts:

"scripts": {
  "react-template": "plop"
}

In the terminal, type: $ npm run react-template.

Instructions for generating a template

Outlined below are the templates available to you through this package. Give them a try!

Templates

Stateless Component (ES6)

Creates the following component file at ../components/Button/index.js

/**
*
* Button
*
*/
 
import React from 'react';
 
class Button extends React.Component {
  render() {
    return (
      <div>
      </div>
    );
  }
}
 
Button.propTypes = {
 
};
 
export default Button;

Stateless Component (Stateless function)

Creates the following Component file at ../components/Button/index.js

/**
*
* Button
*
*/
 
import React from 'react';
 
function Button() {
  return (
    <div>
    </div>
  );
}
 
Button.propTypes = {
 
};
 
export default Button;

Component test files

These are automatically created for every component you generate

import React from 'react';
import { shallow } from 'enzyme';
 
import Button from '../index';
 
describe('<Button />', () => {
  it('Expect to have unit tests specified', () => {
    expect(true).toEqual(false);
  });
});