Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. import React, { useState } from 'react';
  2.  
  3. function Example() {
  4. // Declare a new state variable, which we'll call "count"
  5. const [count, setCount] = useState(0);
  6.  
  7. return (
  8. <div>
  9. <p>You clicked {count} times</p>
  10. <button onClick={() => setCount(count + 1)}>
  11. Click me
  12. </button>
  13. </div>
  14. );
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement