react-native-auto-timeago

1.0.15 • Public • Published

react-native-auto-timeago

View package on npm npm Build status

An auto-updating timeago component for React Native using moment.js.

Usage

import React, { Component } from 'react';
import TimeAgo from 'react-native-auto-timeago';

// Timestamp can be any valid data type accepted in a Moment.js constructor
// Currently accepts string, number, array, or a Date instance
let timestamp = "1630470872";

class MyComponent extends Component {

  ...

  render() {
    return (
      <TimeAgo short={true} timestamp={timestamp} interval={20000} />
    )
  }

  ...
};

All normal Text props are applicable (including style). Use the interval prop to change the update interval in milliseconds

Package Sidebar

Install

npm i react-native-auto-timeago

Weekly Downloads

0

Version

1.0.15

License

MIT

Unpacked Size

7.62 kB

Total Files

8

Last publish

Collaborators

  • zinmyooo