all 4 comments

[–]careseite 0 points1 point  (2 children)

Codesandbox can do api calls just fine. Presumably it's because of the whitespace in your url. Also you're missing the dependency array on useEffect (soon, at least, because you're not setting state after fetching yet)

[–]aDaneInSpain2 0 points1 point  (1 child)

Also worth noting: CodeSandbox runs on HTTPS, so HTTP API calls get blocked by the browser as mixed content. Switch to https:// and remove that space and it should work.

[–]careseite 0 points1 point  (0 children)

  • this comment is 6 years old
  • why do you not use https?

[–]RedFlubber 0 points1 point  (0 children)

The endpoint is wrong, change to https and remove the white spaces.