node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

react-npm-skeleton

react-npm-skeleton

Basic React app. An ES6 skeleton project for creating react components packaged with npm. This project just aim to display Hello World with React.

npm Version Build Status

Features

  • Display Hello World with h2 tag.
  • Runs in the browser and Node.js.
  • Built on standards.

Example

import React,{Component} from 'react';
import ReactDOM from 'react-dom';
import HelloWorld from 'react-npm-skeleton';
 
class App extends Component {
    constructor(props){
        super(props);
    }
 
    render() {
        return(
            <div>
            <HelloWorld />
            </div>
        );
    }
}
 
ReactDOM.render(<App />,document.querySelector('.container'));
 

This example would render: "Hello World" in H2 tag into the container element on the page.

Technology Stack:

  • react
  • mocha

Usage:

Clone the repo as a new project:

git clone https://github.com/lobdev/react-npm-skeleton.git <shiny-new-project>

Start Server:

First you have to replace the lib/component/hello_world.js to server.js in package.json
cd shiny-new-project
npm i
npm start

Run App:

npm start command automatically initiate browser at 3000 port
http:://localhost:3000

Run tests:

cd shiny-new-project
npm i
npm test

Developer Notes:

Make sure you configure your editor/IDE to use:

.editorconfig
.eslintrc