Expected an assignment or function call and instead saw an expression is a common error whenever I forget adding return keyword to a function.
if(!loading) {
return <p>Loading...</p>
}
else if (error) {
<p>Some error occurred</p>
//Error
}
In the else if return statement, I missed the return keyword, causing this error.

if(!loading) {
return <p>Loading...</p>
}
else if (error) {
return <p>Some error occurred</p>
}
Problem solved.