Where to apply my moment() function in a react component?
问题 I am trying to do a clock component, simply to give the date and time in local format in a webpage. I imported MomentJS using the command line npm i moment --save in my webpack environment. Next I wrote this in my Clock.jsx component (mostly based on the React example on the website). import React from 'react'; import Moment from 'moment'; export default class Clock extends React.Component { constructor(props) { super(props); this.state = { dateTimestamp : Date.now() }; } tick = () => { this