remotion-dev / remotion

🎥 Make videos programmatically with React

Home Page:https://remotion.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with `defaultProps` placement in Remotion causing error when saving default props.

JonnyBurger opened this issue · comments

From message posted on Discord by d3ch0

Does anyone know if this is a bug. Definiting defaultProps BEFORE id seems to give this error in the Studio:

Can't save default props: No `defaultProps` prop found in the <Composition/> tag with the ID "HelloWorld"..
// Root.tsx > RemotionRoot component
<>
  // ✅ this works
  <Composition
    id="HelloWorld"
    defaultProps={{ titleText: "Welcome to Remotion" }}
  />
  // ❌ not working because defaultProps are BEFORE id
  <Composition
    defaultProps={{ titleText: "Welcome to Remotion" }}
    id="HelloWorld"
  />
</>

I'm just starting with Remotion so maybe im missing something.