I need to send a http request when the react component has loaded. I'm using the react useEffect
function. The problem is that the useEffect function is called multiple times.
I searched and found that to call react useEffect once you need to add [] after the callback function. I tried this but it doesn't work. Thank you
This is my code:
const LoginPage = () => {
useEffect(() => {
console.log("Log");
}, []);
return (
<div className="login-container">
</div>
);
};
export default LoginPage;