Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 672 Bytes

File metadata and controls

21 lines (13 loc) · 672 Bytes

Life Cycle in REACT

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

Description

This is a small example of how to use fetch-api to connect to an api. In this case we connect to https://api.coindesk.com/v1/bpi/currentprice.json, so we get a json with the values of the bitcoins.

The global "fetch" method helps us make a request to an endpoint of an API from the life cycle: componentDidMount.

It also contains several examples of:

  • How the different life cycles work in REACT.
  • Container Pattern - Content