I have gone through hooks introduced in react v16.7.0.
https://reactjs.org/docs/hooks-intro.html
So my understanding about hooks is we can play with state in functional component without writing class components in react. This is really amazing feature.
But I am not getting clear picture about using hooks in functional components.
import { useState } from 'react';
function Example() {
const [count, setCount] = useState(0);
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click me
</button>
</div>
);
}
how can I use life cycle methods in the above functional component if I use hooks?