-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
A way to render synchronously #4044
Comments
You can leverage something like
|
Ohhh, nice 💯 . |
Hey @dmail did this work out for you? |
Hi @JoviDeCroock, Short answer Detailed answer In our case instead of doing things in sequence and synchronously: 1. send message to iframe using postMessage
2. update UI in the parent page We are waiting between step 1 and 2 (using setTimeout for now) 1. send message to iframe using postMessage
+2. wait for the iframe UI to be updated
3. update UI in the parent page This way there is no intermediate state displayed to the user. |
Thank you very much for the help and reactivity ❤️ |
Awesome, glad to hear you got this resolved. I'll close this issue out then :) |
Describe the feature you'd love to see
I need a way to update the UI synchronously using preact. Ideally something like flushSync.
Additional context
In my use case:
Currently we see an intermediate state where the surrounding is updated and button is still displayed.
This intermediate state lasts <1ms, the time for preact to update the UI.
Intermediate states are undesirable as they cause blinks on the button.
With react I could do something like that:
But in preact I don't know what I could do
Related
The text was updated successfully, but these errors were encountered: