diff --git a/native/chat/timestamp.react.js b/native/chat/timestamp.react.js --- a/native/chat/timestamp.react.js +++ b/native/chat/timestamp.react.js @@ -15,11 +15,25 @@ }; function Timestamp(props: Props): React.Node { const styles = useStyles(unboundStyles); - const style = [styles.timestamp]; - if (props.display === 'modal') { - style.push(styles.modal); - } - return {longAbsoluteDate(props.time)}; + const style = React.useMemo( + () => + props.display === 'modal' + ? [styles.timestamp, styles.modal] + : [styles.timestamp], + [props.display, styles.modal, styles.timestamp], + ); + + const absoluteDate = React.useMemo( + () => longAbsoluteDate(props.time), + [props.time], + ); + + const timestamp = React.useMemo( + () => {absoluteDate}, + [absoluteDate, style], + ); + + return timestamp; } const timestampHeight = 26;