1.0.15 • Published 4 years ago
react-native-auto-timeago v1.0.15
react-native-auto-timeago
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