What cleanup functions can be used with this useEffect hook?
P粉364642019
P粉364642019 2023-09-15 16:37:58
0
1
369

I can't figure out what cleanup function to apply in this useEffect hook. It works fine without the cleanup function.

useEffect(() => {
            const fetchProfileUser = async () => {
                if (profileUserId === existingUser._id) {
                    setprofileUser(existingUser);
                } else {
                    const profileUser = await UserApi.getUser(profileUserId);
                    setprofileUser(profileUser);
                }
            };
            fetchProfileUser();
        });

P粉364642019
P粉364642019

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!