cancelRender()
Available from v3.3.44
By invoking cancelRender()
, Remotion will stop rendering all the frames, and not do any retries.
Pass a string
or an Error
(for best stack traces) to cancelRender()
so you can identify the error when your render failed.
Example
MyComposition.tsxtsx
importReact , {useEffect ,useState } from "react";import {cancelRender ,continueRender ,delayRender } from "remotion";export constMyComp :React .FC = () => {const [handle ] =useState (() =>delayRender ("Fetching data..."));useEffect (() => {fetch ("https://example.com").then (() => {continueRender (handle );}).catch ((err ) =>cancelRender (err ));}, []);return null;};
MyComposition.tsxtsx
importReact , {useEffect ,useState } from "react";import {cancelRender ,continueRender ,delayRender } from "remotion";export constMyComp :React .FC = () => {const [handle ] =useState (() =>delayRender ("Fetching data..."));useEffect (() => {fetch ("https://example.com").then (() => {continueRender (handle );}).catch ((err ) =>cancelRender (err ));}, []);return null;};