Fetch Flashcards
1
Q
What does fetch( ) return?
A
- returns a promise
2
Q
How do you specify the request method (GET, POST, etc..) when calling fetch( )?
A
- use an init Object as the second argument to fetch( ), and set the method property of that object.
3
Q
When does React call a component’s componentDidMount( ) method?
A
- immediately after a component is mounted (inserted into the tree)
(after the first successful render)
4
Q
Name three React.Component lifecycle methods:
A
- constructor( ), render( ), componentDidMount( ), componentDidUpdate( )
5
Q
How do you pass data to a child component?
A
- using props