Fetch Flashcards
What does fetch( ) return?
returns a promise that’s fulfilled once a response is available, the response object is a representation of the entire HTTP response which you have to extract the JSON body content using the json( ) method
What is the default request method used by fetch( )?
get
How do you specify the request method (GET, POST, etc.) when calling fetch?
init object, { method: ‘GET’ }
When does React call a component’s componentDidMount method?
when a component is inserted into the tree, after constructor( ) and render( )
Name three React.Component lifecycle methods.
componentDidMount, componentDidUpdate, componentWillUnmount, render, constructor
How do you pass data to a child component?
through props