You can add any kind of logic to a simple app like basic counter in React. This counter can be controlled and it is following following rules:
1- Count up from zero or a given value to infinity and keep counting until interrupted, count next value each next second
2- Count Down to Zero from any given number
3- Pause counter to any moment
4- Reset counter and stop
Interesting React tutorial that also covers setInterval and clearInterval concepts in a little bit more detail.