title: React useEffect and return render
body: <p>I have a useEffect with fetch and I would like to render it first, since it runs the else case first and then runs the useEffect. Which shows the else case then the posts when viewing the page. Is there a way to render useEffect first?</p>
  
  <pre><code>const [posts, setPosts] = useState([]);
  
  useEffect(() =&gt; {
    const data = await fetch('https://localhost:1111/api/posts', {
      credentials: 'include'
    });
    const response = await data.json();
    setPosts(response);
  }, []);
  
  return (
    &lt;div&gt;
      {posts.length &gt; 0 ? (
        posts.map(post =&gt; (
          &lt;Post key={post.id} onUpdate={() =&gt; handleUpdate()} post={post} /&gt;
        ))
      ) : (
        &lt;p&gt;No posts&lt;/p&gt;
      )}
    &lt;/div&gt;
  );
  </code></pre>