This basic project shows how to Fetch data from an API and map(…) to React-Virtual-DOM, re-using the same component.

For more info see this other Blog-Post: XMLHttp  —   Fetch()..API–JavaScript

The data comes from a file “data.json” hosted in my GitHub, click to see: data.json

Download the full project from GitHub:  Fetch-&-Map(…)

This project will render:

Here you can see 3 of the 10 elements rendered.


I hope this was useful.

Star Wars API  –  SWAPI

This is a basic example in how to use the SWAPI, the following is the React.js code to pull the name of Luke Skywalker, in this code example we are not making any queries, so ignore the value of this.state.search. the character query is hard-coded. in the URL  const srcAPI  = “https://swapi.co/api/people/1” with the sufix:  …/people/1 


SWAPI Find character by Number:

The code for this is on this Repo: Star Wars API – SWAPI-1


Find Countries by Population:

Using the API: https://restcountries.eu/#rest-countries



Copyright 2017. All rights reserved.

Posted October 9, 2017 by Edmundo in category "React