4 ms·
It fetches data from an endpoint then sets component state based on the response
by Secretmapper 9y ago
It fetches data from an endpoint then sets component state based on the response
- TekMol 9y agoWell, it makes a http request but it seems to do nothing with the data returned.
- Secretmapper 9y agoThe data is set as component state .then( planet => this.setState({ loading: false, planet }), error => this.setState({ loading: false, error }) );