Capítulo 67 de 988

Chapter 67: Passing props to a composition

Core Idea

Reference page for Passing props to a composition in the Remotion documentation.

Key Concepts

  • Defining accepted props
  • Define default props
  • Optional: Define a schema<AvailableFrom v="4.0.0"/>
  • Input props
  • Passing input props in the CLI
  • Passing input props when using server-side rendering
  • Passing input props in GitHub Actions
  • Retrieve input props

Code Examples

type Props = {
  propOne: string;
  propTwo: number;
}

export const MyComponent: React.FC<Props> = ({propOne, propTwo}) => {
  return (
    <div>props: {propOne}, {propTwo}</div>
  );
}
// - MyComponent
  • What it demonstrates: Usage pattern for Passing props to a composition from the official docs.

Key Takeaways

  1. Understand defining accepted props when working with Passing props to a composition.
  2. Understand define default props when working with Passing props to a composition.
  3. Understand optional: define a schema<availablefrom v="4.0.0"/> when working with Passing props to a composition.
  4. Understand input props when working with Passing props to a composition.
  5. Understand passing input props in the cli when working with Passing props to a composition.

Connects To

  • Cancel Render: related page in the Hooks & Data APIs section.
  • Continue Render: related page in the Hooks & Data APIs section.
  • Data Fetching: related page in the Hooks & Data APIs section.