Mojang / ore-ui

💎 Building blocks to construct game UIs using web tech.
https://react-facet.mojang.com/
MIT License
409 stars 18 forks source link

Non-blocking DeferredMountWithCallback #35

Closed xaviervia closed 9 months ago

xaviervia commented 2 years ago

As of https://github.com/Mojang/ore-ui/pull/34, when DeferredMountWithCallback is used, all deferred rendering is paused until that callback is invoked.

To avoid blocking all rendering, we might want to place the callback in a second queue for notifying when all rendering is complete, but avoid blocking the start of render of the next component. This should be optional, so that we can also block when waiting for render to be completed before starting the next.

This change does not break API.

We should introduce a new property for signalling when we explicitly want to block further rendering, it could look something like this:

<DeferredMountWithCallback isBlocking>
  <ComponentThatShouldBeWaitedFor />
</DeferredMountWithCallback>
pirelenito commented 9 months ago

Deferred mount is being deprecated with #59