Fetch json data from a url in React (and NextJS) – 3 easy ways

Let’s look at 3 ways to fetch JSON data from an API using the Fetch API and NextJS’s getServerSideProps. I’ll show you all 3 options, any of which you can use to get data from JSON and display it on your page.

This is very common especially for displaying dynamic content from say a blog or portfolio. There is hardly a project today that doesn’t require some sort of fetching from an external API. Let’s go.

CONNECT ON MY DISCORD:
https://discord.gg/5zsdrxH8m8

Twitter:https://twitter.com/omarel
GitHub: https://github.com/oelbaga

#fetchdata #react #nextjs #getserversideprops

Source: https://www.youtube.com/watch?v=D-U0OkP5kwg

Leave a Reply

Your email address will not be published. Required fields are marked *