What's the process for obtaining these providers?
I recently followed the JavaScript Mastery tutorial step by step, however, I encountered an issue with the useEffect hook to fetch the providers (I even tried using alert to check, but it keeps showing null).
Below is the code snippet that includes the providers - please help me identify what could be wrong:
const [providers, setProviders] = useState(null);
const [toggleDropdown, setToggleDropdown] = useState(false);
useEffect(() => {
const setUpProviders = async () => {
const response = await getProviders();
setProviders(response);
};
setUpProviders();
}, []);