diff --git a/snippets/Timer.md b/snippets/Ticker.md similarity index 82% rename from snippets/Timer.md rename to snippets/Ticker.md index 5e25334ef..0bc1f89eb 100644 --- a/snippets/Timer.md +++ b/snippets/Ticker.md @@ -1,15 +1,15 @@ -### Timer +### Ticker -Renders a timer component. +Renders a ticker component. -- The timer state is initially set to zero +- The ticker state is initially set to zero - When the `Tick!` button is clicked, `timer` is incremented periodically at the given `interval` - When the `Reset` button is clicked, the value of the timer is set to zero and the `setInterval` is cleared - The `setInterval` is cleared once the desired `time` is reached - `time` and `interval` are the required props ```jsx -class Timer extends Component { +class Ticker extends Component { constructor(props) { super(props); this.state = {timer: 0} @@ -45,5 +45,5 @@ class Timer extends Component { ``` ```jsx -ReactDOM.render(, document.getElementById('root')); +ReactDOM.render(, document.getElementById('root')); ```