|
@@ -102,19 +102,19 @@
|
|
|
|
|
|
<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,8-11|17|22-24">
|
|
|
+ <pre data-id="code-animation"><code class="hljs" data-trim data-line-numbers="|4,8-11|17|22-24"><script type="text/template">
|
|
|
import React, { useState } from 'react';
|
|
|
|
|
|
function Example() {
|
|
|
const [count, setCount] = useState(0);
|
|
|
|
|
|
return (
|
|
|
- <div>
|
|
|
- <p>You clicked {count} times</p>
|
|
|
- <button onClick={() => setCount(count + 1)}>
|
|
|
+ <div>
|
|
|
+ <p>You clicked {count} times</p>
|
|
|
+ <button onClick={() => setCount(count + 1)}>
|
|
|
Click me
|
|
|
- </button>
|
|
|
- </div>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -122,15 +122,15 @@
|
|
|
const [count, setCount] = useState(0);
|
|
|
|
|
|
return (
|
|
|
- <div>
|
|
|
- <p>You clicked {count} times</p>
|
|
|
- <button onClick={() => setCount(count + 1)}>
|
|
|
+ <div>
|
|
|
+ <p>You clicked {count} times</p>
|
|
|
+ <button onClick={() => setCount(count + 1)}>
|
|
|
Click me
|
|
|
- </button>
|
|
|
- </div>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
);
|
|
|
}
|
|
|
- </code></pre>
|
|
|
+ </script></code></pre>
|
|
|
</section>
|
|
|
|
|
|
<section>
|