Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 1.27 KB

README.md

File metadata and controls

62 lines (43 loc) · 1.27 KB

Reloading

npm version Build Status

A Loading component for React.

Installation

npm install --save reloading

Usage

var React = require('react');
var Loading = require('reloading');

var App = React.createClass({
  getInitialState: function () {
    return {
      loading: false
    };
  },

  doRequest: function () {
    this.setState({
      loading: true
    });
  },

  completeRequest: function () {
    this.setState({
      loading: false
    });
  },

  render: function() {
    return (
      <div>
        Hello, world! I am a React Loading Component.
        <Loading shouldShow={this.state.loading} />
      </div>
    );
  }
});

Properties

Loading Text
<Loading shouldShow={this.state.loading} text='Checking your details...' />

Development

Install http-server from npm, run it and go to http://127.0.0.1:8080/

npm install -g http-server
npm run serve

In another tab:

npm run watch