Skip to content

Getting data and passing to state #199

Answered by dai-shi
ghost asked this question in General
Discussion options

You must be logged in to vote
  const data = getData();
  loadData(data);

The data returned by getData() is a promise.
So, you may need to do like this:

  getData().then(loadData);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant