Package Exports
- @tamalweb/use-time-ago
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 (@tamalweb/use-time-ago) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@tamal3053/use-time-ago
React hook for time since current time in readable format. React Time Ago Custom Hook.
Note: This is using the new React Hooks API Proposal which is subject to change until React 16.7 final.
You'll need to install
react,react-dom, etc at^16.7.0-alpha.0
Install
yarn add tamal3053/use-time-agoUsage
import useTimeAgo from 'tamal3053/use-time-ago';
function MyComponent() {
return useTimeAgo( new Date() - 360000 ); // 6 minutes ago
}