Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import React, { useState } from 'react';
  2. const Count = () => {
  3. const [count, setCount] = useState(0);
  4. return (
  5. <div>
  6. <div>
  7. <button onClick={() => setCount(count + 1)}> + Increment</button>
  8. <button onClick={() => setCount(count - 1)}> - Decrement</button>
  9. </div>
  10. <div>
  11. Current: {count}
  12. </div>
  13. </div>
  14. );
  15. }
  16. export default Count;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement