You are viewing an old version of this page. View the current version.
Compare with Current
View Version History
Version 1
Next »
Introduction
I was putting together some code to demonstrate how modifying a state variable causes a component to rerender. All was going will until I put a timer on the component, that got the current and displayed it in the page. That worked fine example 1, but it all changed when I wanted to keep a list of all the times and print them all out each time a new time was added, things a got a little weird, example 2.
Example 1.
Get the time and continually display it