Calling function at set intervals in React presentational component [duplicate]
问题 This question already has answers here : javascript setTimeout() not working [closed] (7 answers) setInterval/setTimeout return value (6 answers) Closed 2 years ago . I'm trying to implement a ticking timer using moment.js in my presenational React component. As a first step, I wanted to just call a function every second but instead of getting the text the function should return, I'm getting an int value. Any idea how I should implement this? Here's my component: import React, { PropTypes }