Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { useState } from 'react';
- const Count = () => {
- const [count, setCount] = useState(0);
- return (
- <div>
- <div>
- <button onClick={() => setCount(count + 1)}> + Increment</button>
- <button onClick={() => setCount(count - 1)}> - Decrement</button>
- </div>
- <div>
- Current: {count}
- </div>
- </div>
- );
- }
- export default Count;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement