Class SchedulerUtil

java.lang.Object
react4j.internal.SchedulerUtil

public final class SchedulerUtil extends Object
Utilities for interacting with the Arez scheduler.
  • Method Details

    • pauseUntilRenderLoopComplete

      public static void pauseUntilRenderLoopComplete()
      The first time an react4j view is rendered it will lock the Arez scheduler and release the lock in the micro-task immediately following the task that prompted the render. If this is not done it is possible that Arez can re-trigger a view render when the scheduler is triggered after the tracked render completes but before the render method has returned to the react runtime. This results in error message from react as a setState()/forceRender() was invoked while still within a render() method.

      NOTE: While render methods are read-only transactions, they can un-observe components with ArezComponent.disposeOnDeactivate() set to true that would result in the arez component being disposed and triggering an update that would mark particular React view/Observers as STALE and trigger a re-render of that view.