1.0.0 • Published 7 years ago

@axetroy/react-now v1.0.0

Weekly downloads
4
License
MIT
Repository
-
Last release
7 years ago

react-now

Greenkeeper badge

react component for rend the time now. update in every seconds

Install

yarn add @axetroy/react-now

Usage

import React, { Component } from 'react';
import { render } from 'react-dom';
import Now from '@axetroy/react-now';

class App extends Component {
  render() {
    return (
      <Now interval={1000}>
        {time => {
          return <span>{time.toString()}</span>;
        }}
      </Now>
    );
  }
}

const element = document.createElement('div');
document.body.appendChild(element);
render(<App />, element);

Props

  • interval: number

ref: setInterval(function, interval)

default: 1000

Run the Demo

git clone https://github.com/axetroy/react-now.git
yarn
yarn start

License

The MIT License

1.0.0

7 years ago

0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago