Skip to content

Commit 88afd70

Browse files
committed
Timestamp component performance improvement
1 parent 9ea68aa commit 88afd70

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "notabug",
3-
"version": "0.8.23",
3+
"version": "0.8.24",
44
"dependencies": {
55
"@trust/webcrypto": "^0.9.2",
66
"babel-cli": "^6.26.0",

src/components/notabug/Timestamp.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import React from "react";
1+
import React, { PureComponent } from "react";
22
import TimeAgo from "react-timeago";
33

4-
export const Timestamp = ({ created_utc }) => (created_utc && <TimeAgo date={created_utc * 1000} />) || null;
4+
class PureTimestamp extends PureComponent {
5+
render () {
6+
const { created_utc } = this.props;
7+
return (created_utc && <TimeAgo date={created_utc * 1000} />) || null;
8+
}
9+
}
10+
11+
export const Timestamp = ({ created_utc }) => <PureTimestamp created_utc={created_utc} />;

0 commit comments

Comments
 (0)