Should I use IIFE in useEffect hook?
Is it good practice to use IIFE in useEffect or I should declare async function and then call it?
useEffect(() => {
(async () => {
const response = await fetch(
"https://jsonplaceholder.typicode.com/posts"
);
const json = await response.json();
setPosts(json);
})();
});