-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First immediate api call has no result callback #1769
Comments
I have to add a delay to solve it. I have no idea why. |
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 😃 |
I had the same issue, |
Me too i got the same issue, add i fixed it by adding a delay of 1ms. i know that's not the best solution, but it's the only one i found. Hope this bug will be fixed soon. |
Don't know how but removing the ToggleStoryBook from app.tsx solves the issue. And works smoothly |
Hi @abhisekz, |
hi @kateinkim , |
Hey @momolafrooo & @abhisekz! |
Indeed! Big thanks to Gerrard, whomever they may be on GitHub for commenting on my blog post about how my async functions called from hooks or events weren't completing: https://mrmurphy.dev/async-functions-not-completing-in-react-native/ |
this issue i think not about the ignite, but about using async / promises on useEffect. |
@syafiqmb Maybe not ignite specific. In my specific case, this isn't about passing an async function to In my situation there were two possible fixes:
I don't know enough about |
I can confirm, this issue persists in my project with ignite, first I thought it's because of the MST problem then I changed to Mobx, the problem is still there. 😞 all of my api call getting stuck because of this problem, hopefully, soon someone could find the solution Thanks for the removing
|
I had a similar issue with another async/await call never returning. Removing ToggleStorybook also worked for me in a completely different context. I don't claim to understand why, just giving feedback here. |
I have spent days until I find this issue through discussions. Deleting toggle storybook also resulted in resolving all my problems that I thought coming from MST, or MST-QGL and now everything works, waaaaaah! I believe it is better to configure the base app without toggle story book until this issue is resolved, just to give people a nice setup without any issues to start developing their apps. |
this should be resolved by #1906, you should check this again with the latest version or apply the patch from the PR to your own project. |
@kateinkim can you verify that #1906 resolved the issue and close it if has? |
Just tested this again and it seems like it is resolved by #1906. Closing this. |
What's going on?
First api call in the first screen has no result callback
Steps to reproduce
<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 fileIt only happen in the initial screen.
npx ignite-cli doctor
results:System
platform darwin
arch x64
cpu 12 cores Intel(R) Core(TM) 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
The text was updated successfully, but these errors were encountered: