Chapter 7

Answer 1: A promise is an object the represents the result of an asynchronous operation. The use of promises simplifies the code when doing asynchronous calls.

Answer 2: The Fetch API provides fetch() method that you can use to make asynchronous calls using the JavaScript.

Answer 3: The REST API  fetch() call is recommended to do inside the componentDidMount() life cycle method that is invoked when the component has been mounted.

Answer 4: You can access the response data using the promises with the fetch() method. The data from the response is saved to the state and the component is re-rendered when the state has changed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.28.179