title: Axios first get the response and then render form TypeError: Cannot read property '***' of undefined
body: <pre><code>const [projectData, setprojectData] = useState();
  useEffect(() =&gt; {
      Axios.get(`/fetch-project-details/${id}`, {
          headers: {
              &quot;x-access-token&quot;: localStorage.getItem(`login`)
         }
      }).then((response) =&gt; {
          let result = response.data.recordset;
          setprojectData(result[0]); // store array in state projectData
      });
  },[]);
  
  
  return (
      &lt;div&gt;
      &lt;h1&gt;{projectData.title}&lt;/h1&gt;
      ... other code
  
  );
  </code></pre>
  <p>I am getting ** TypeError: Cannot read property 'title' of undefined **</p>
  <p>How to first get the data and then pass it down ?</p>