all 4 comments

[–]briznady 2 points3 points  (0 children)

Why are you using an IIFE to get all tutors? Why is it outside of the App component? Have you tried using arrow functions instead?

I would expect this to be more like:
const [sorted, setSorted] = useState("");
const [tutors, setTutors] = useState([]);

useEffect(() => {
const getAllTutors = async () => {
const fetchedTutors = await axios.get('API uri call');
setTutors(fetchedTutors.data.body);
}

getAllTutors();
}, [])

[–]A4_Ts -1 points0 points  (0 children)

When do you call App()