Managing side effects such as data fetching, subscriptions, and manually changing the DOM can become challenging when building React applications. React`useEffect`useEffect
#### What is `useEffect` ?
The `useEffect
Here’s a simple example:
```
import React, { useState, useEffect } from 'react';
const ExampleCode = () => {
const [count, setCount] = useState(0);
useEffect(() => {
document.title = `You clicked ${count} times`;
}, [count]);
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click me
</button>
</div>
);
}
```
In this example, the document title updates every time the `count`useEffect`document.title`count