Skip to main content

reevaluateComposition()v4.0.167

Re-runs calculateMetadata() on the currently selected composition.
This is useful if the function relies on:

  • The public/ folder
  • Randomness
  • Changing network resources
  • Time

Example

Re-run calculateMetadata() on the currently selected composition
tsx
import React, { useCallback } from "react";
import { reevaluateComposition } from "@remotion/studio";
 
export const ReevaluateCompositionComp: React.FC = () => {
const reevaluate = useCallback(async () => {
reevaluateComposition();
 
console.log("Re-evaluated!");
}, []);
 
return <button onClick={reevaluate}>Re-evaluate</button>;
};
Re-run calculateMetadata() on the currently selected composition
tsx
import React, { useCallback } from "react";
import { reevaluateComposition } from "@remotion/studio";
 
export const ReevaluateCompositionComp: React.FC = () => {
const reevaluate = useCallback(async () => {
reevaluateComposition();
 
console.log("Re-evaluated!");
}, []);
 
return <button onClick={reevaluate}>Re-evaluate</button>;
};

See also