diff options
Diffstat (limited to 'demo.html')
-rw-r--r-- | demo.html | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -102,7 +102,7 @@ <section data-auto-animate> <h2 data-id="code-title">With animations</h2> - <pre data-id="code-animation"><code class="hljs" data-trim data-line-numbers="|4|4,8-11"> + <pre data-id="code-animation"><code class="hljs" data-trim data-line-numbers="|4,8-11|17|22-24"> import React, { useState } from 'react'; function Example() { @@ -117,6 +117,19 @@ </div> ); } + + function SecondExample() { + const [count, setCount] = useState(0); + + return ( + <div> + <p>You clicked {count} times</p> + <button onClick={() => setCount(count + 1)}> + Click me + </button> + </div> + ); + } </code></pre> </section> |