-function linkify( selector ) {
- if( supports3DTransforms ) {
+
+import React, { useState } from 'react';
- var nodes = document.querySelectorAll( selector );
+function Example() {
+ const [count, setCount] = useState(0);
- for( var i = 0, len = nodes.length; i < len; i++ ) {
- var node = nodes[i];
-
- if( !node.className ) {
- node.className += ' roll';
- }
- }
- }
+ return (
+ <div>
+ <p>You clicked {count} times</p>
+ <button onClick={() => setCount(count + 1)}>
+ Click me
+ </button>
+ </div>
+ );
}
Code syntax highlighting courtesy of highlight.js.
@@ -394,10 +394,9 @@ Reveal.addEventListener( 'customevent', function() {
// More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [
- { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
- { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
+ { src: 'plugin/highlight/highlight.js' },
{ src: 'plugin/search/search.js', async: true },
{ src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true }