Package Exports
- @axetroy/react-now
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@axetroy/react-now) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-now
react component for rend the time now. update in every seconds
Install
yarn add @axetroy/react-nowUsage
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 startLicense
The MIT License