K
K
Korifa2019-05-27 23:18:02
JavaScript
Korifa, 2019-05-27 23:18:02

How to return result from fetch inside a function?

How to return a result from getCity from fetch so that it can be used in another function
5cec45c475bad716653345.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hzzzzl, 2019-05-27
@Korifa

return where?
register in the state
.then(data => this.setState({data: data}))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question