A component is considered to be mounted when it is first rendered to the DOM. Mounting and unmounting are part of a component's lifecycle. There are special methods called and which run after a component is mounted and unmounted respectively. We can set up a timer here that will update the state of our component every two seconds.
2 Comments
Sort: