Using a REST API in react

By DEV Community - 2020-12-30

Description

WHAT IS AN API An API stands for an "Application Programming Interface". It allows communi... Tagged with webdev, react, html, javascript.

Summary

  • WHAT IS AN API An API stands for an "Application Programming Interface".
  • As the name implies, it gets the data directly from the API.
  • This method is used to eradicate pieces of information or data that are not needed.
  • In the fetchData function, we set the state to the response of every joke we get from the API setJokes([res.data.joke]);.In the return statement we passed in the fetchData function to a button, for any time we click the button it loads new jokes .

 

Topics

  1. Frontend (0.29)
  2. Backend (0.19)
  3. Database (0.1)

Similar Articles

Top 5 Cryptocurrency APIs for Developers

By Medium - 2020-06-07

In this article, we learn the top 5 best crypto APIs in 2020. Learn how to develop with Python for accurate cryptocurrency market data endpoints, crypto price api, Live price streaming, crypto social ...

10 Fun APIs to Use For Your Next Project

By DEV Community - 2021-01-01

To put it simply: a web API (application programming interface) is a tool which tells a particular sy... Tagged with javascript, webdev, todayilearned, productivity.

How to Fetch Data in React: Cheat Sheet + Examples

By freeCodeCamp.org - 2021-02-12

There are many ways to fetch data from an external API in React. But which one should you be using for your applications in 2021? In this tutorial, we will be reviewing five of the most commonly used ...

Making concurrent API calls in Node

By DEV Community - 2020-12-27

The problem When building up a backend API, it is common that we need to fetch data from a... Tagged with node, javascript.