Error

When using Link of react-router-dom to redirect page, I got this error: destroy is not a function TypeError: destroy is not a function

Solution

Just seperate the runinning code and make it a function.
const getResult = async () => {
       setClients(res.result);
};

useEffect(() => {
    setLoading(false);
    getResult();
}, []);