question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

First immediate api call has no result callback

See original GitHub issue

What’s going on? First api call in the first screen has no result callback

Steps to reproduce

  1. switch the stack screen order in ‘main-navigator.tsx’ to be <Stack.Screen name="demoList" component={DemoListScreen} /> <Stack.Screen name="welcome" component={WelcomeScreen} />

then start the program, you will find out it will never get the result const result = await characterApi.getCharacters() in character-store.ts file

It only happen in the initial screen.


npx ignite-cli doctor results: System platform darwin arch x64 cpu 12 cores Intel® Core™ i7-8700 CPU @ 3.20GHz directory canbeDeleted /Users/maci/Documents/git/canbeDeleted

JavaScript (and globally-installed packages) node 16.3.0 /usr/local/bin/node npm 7.17.0 /usr/local/bin/npm npm 7.17.0 yarn 1.22.10 yarn 1.22.10 /usr/local/bin/yarn code-push-cli 2.1.9 ignite-cli 7.0.3

Ignite ignite-cli 7.0.3 /usr/local/bin/ignite ignite src build /Users/maci/.config/yarn/global/node_modules/ignite-cli/build

Android java 1.8.0_261 /usr/bin/java android home - /Users/maci/Library/Android/sdk

iOS xcode 12.5.1 cocoapods 1.10.1 /usr/local/bin/pod

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
abhisekzcommented, Sep 8, 2021

Don’t know how but removing the ToggleStoryBook from app.tsx solves the issue. And works smoothly

5reactions
kateinkimcommented, Aug 16, 2021

Hi @Magrider! We have noticed this issue in other cases and what you did by adding a delay does solve the issue. This is a workaround that we are currently recommending. We are trying to figure out why this is happening and we would like to solve it as quickly as possible. Thanks 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Callback not getting executed when I expect it - Stack Overflow
Rather than the callback being immediately run when the promise is fulfilled, it seems to wait until all the rest of my code...
Read more >
REST API call in SharePoint gets result, but when returns ...
I am getting the items in console. But when trying to access ' result ' variable it showing undefined. how can I return...
Read more >
Using asynchronous API's using callbacks and Promises
An asynchronous function that retrieves data via another thread cannot directly return the data to the caller because the data is not necessarily...
Read more >
Getting a result from an activity - Android Developers
For this reason, the Activity Result APIs decouple the result callback from the place in your code where you launch the other activity....
Read more >
Understanding the Event Loop, Callbacks, Promises, and ...
You want to work with the data from the API call, but you have to make sure the data is returned first.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found