useDelayRender()v4.0.342
A React hook that provides scoped delayRender(), continueRender() and cancelRender() (from v4.0.374) functions for React components.
This is the recommended approach instead of using the global delayRender(), continueRender() and cancelRender() functions directly.
✅ Preferred - use useDelayRender()import {useDelayRender } from 'remotion'; constMyComp :React .FC = () => { const {delayRender ,continueRender ,cancelRender } =useDelayRender (); return <div >My component</div >; };
⚠️ Discouraged - global APIsimport {continueRender ,delayRender } from 'remotion';
Why use useDelayRender() over global delayRender()?
With this hook, you can scope the delays to a specific render.
This makes it future-proof for browser rendering.
It is recommended to use this hook instead of the global delayRender() function.
Errors in a Player or Thumbnailv4.0.548
Inside a Player or Thumbnail, errors passed to the scoped cancelRender() reach that instance's errorFallback, including calls from asynchronous callbacks. A Player also emits its error event. Other players are unaffected. Calls from an unmounted composition or a replaced component or lazyComponent do not report an error to the current instance.
Both scoped and global cancelRender() always throw, including calls from stale or unmounted compositions. The scoped function notifies its active Player or Thumbnail before throwing. A promise using .catch(cancelRender) therefore remains rejected, and callers must handle that rejection when needed. Promises that never call scoped cancelRender() still need their own error handling.
Compatibility
| Browsers | Environments | |||||
|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | ||||
No-op | ||||||
See also
delayRender()- The underlying APIcontinueRender()- Manual render continuationcancelRender()- Cancel render on error- Data fetching guide