Closed AdamRamberg closed 8 months ago
@marlonicus As mentioned above, adjusted the test according to your feedback!
I also want to mention that I removed the requestingToRun
state, since it is no longer needed (the 2nd effect will always first time anyways and after that the state works exactly like the isDeferring
state).
As we are deprecating @react-facet/deferred-mount
with #59, I'm closing this PR.
Before this PR the
<DeferredMountProvider/>
would never defer again after initial deferring has been completed. In practice this meant that if a new child with a<DeferredMount/>
or with a<DeferredMountWithCallback/>
was mounted added after initial deferring was completed, theuseIsDeferring()
hook would still returnfalse
. This PR changes that behaviour and sets the defer state totrue
every time a new child with<DeferredMount/>
or<DeferredMountWithCallback/>
is mounted. An example of where this behaviour would be useful and expected is when you have routing inside a<DeferredMountProvider/>
.