How React Suspense and Concurrent Mode Fit Into The Picture #1746
Replies: 1 comment 14 replies
-
I'm not sure if
Quite frankly the Suspense, even if partially working already, is not mainstream yet and patterns etc are not yet fully emerged. I'm not sure if we are best suited here for figuring them out - I would much more prefer to just learn from others' findings and incorporate best ideas to XState. That being said - I'm thinking about this from time to time, there is just so many things that we still can do for the XState itself that are not as uncertain as integrating with Suspense that this is pretty low on my priority list. |
Beta Was this translation helpful? Give feedback.
-
Without changing XState to suit React's needs, what ways do we think would be possible to allow support for Suspense to be used with things such as invoked promises? I do believe this will benefit more than just React users in the future as UI as a first-class feature potentially becomes a more popular idea.
Idea
I'd imagine that extremely basic support would involve exposing the promise that was invoked so that it could be thrown, for example:
To re-iterate, I don't think XState needs to really change hardly anything, just being able to see the promise should be enough. As of right now, I can't find any way to view the promise from the result of
useMachine()
at all — I'm assuminguseMachine
isn't the problem here.What do we have currently?
I've found that you can see some info about your invoked thing by looking at
.activities
, sadly it doesn't provide what we need. Here is an example of what can be found in.activites
:If you'll notice above, there is a
.src
on the activity itself but it is just theid
again for some reason.Discussion
If anyone has any other ideas on how this could work feel free to bring your ideas, this discussion is open.
Beta Was this translation helpful? Give feedback.
All reactions