have to load useEffect in one time react code example Example: react run useeffect only once useEffect(() => { // Initialization code comes here }, []);