Errata

Learning React

Errata for Learning React

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Na
Chapter 6

Setselectedstars implementation missed. Not clear how it gets into the use state to start with. The description only talks about getting it from use state. Chapter 6

Sanjay  Feb 02, 2021 
Printed Page 29
Last two code samples

There are three problems with the code sample that make it not work. 1. The appid parameter in the example is in upper case, but the server requires it to be in lower case. 2. iOS rejects fetch requests of http by default, so the request should be https. (This is of course a good practice anyway. Please discourage unencrypted http traffic in all your works.) 3. this zip code needs to be provided in a 'zip' parameter.

Changing the code as follows makes it work for me:

const API_STEM = "https://api.openweathermap.org/data/2.5/weather?zip="
function zipurl(zip) {
return `${API_STEM}${zip}&units=imperial&appid=${WEATHER_API_KEY}`;
}


Ian McFarland  May 11, 2022