The issue here is when the component is rendered initially then this.state.singleProject is just an empty object and you are trying to access data.address.street but this gives an error like:
Uncaught TypeError: Cannot read property 'street' of undefined
because data is an empty object initially.
To fix this issue you can simply use optional chaining operator ?. that permits reading the value of a property located deep within a chain of connected objects without having to expressly validate that each reference in the chain is valid.
So, you can update your template like:
return ( <div className="App"> <h1>{data?.email}</h1> <h2>{data?.address?.street}</h2> </div> );
and your code will work fine after that.
