reactjs usestate 28 29 hook

Solutions on MaxInterview for reactjs usestate 28 29 hook by the best coders in the world

showing results for - "reactjs usestate 28 29 hook"
Fabio
12 Mar 2019
1import React, { useState } from 'react';
2
3function Example() {
4  // Declare a new state variable, which we'll call "count"  
5  const [count, setCount] = useState(0);
6  return (
7    <div>
8      <p>You clicked {count} times</p>
9      <button onClick={() => setCount(count + 1)}>
10        Click me
11      </button>
12    </div>
13  );
14}