Fetch Flashcards
1
Q
What doesfetch()return?
A
Returns a promise that resolves with a Response object
2
Q
What is the default request method used byfetch()?
A
GET
3
Q
How do you specify the request method (GET,POST, etc.) when callingfetch?
A
Pass in options object to the fetch() method as a second argument.
Options = { method: REQMETHOD }
4
Q
When does React call a component’scomponentDidMountmethod?
A
Is invoked immediately after a component is mounted (inserted into the tree). After the first successful render.
5
Q
Name three React.Component lifecycle methods.
A
constructor
render
componentDidMount
componentDidUpdate
componentWillUnmount
6
Q
How do you pass data to a child component?
A
As props