SyntaxFix
Write A Post
Hire A Developer
Questions
Just simply add an empty dependenncy array in useEffect it will works as componentDidMount.
componentDidMount
useEffect(() => { // Your code here console.log("componentDidMount") }, []);