Skip to content

NgaChat/react-native-auto-timeago

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 time={timestamp} interval={20000} />
    )
  }

  ...
};

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

About

Auto-updating timeago component for React Native

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published