Capítulo 365 de 988

Chapter 365: saveDefaultProps()

Core Idea

Saves the defaultProps for a composition back to the root file. updateDefaultProps() is an alias for this function.

Key Concepts

  • Examples
  • unsavedDefaultProps
  • Requirements
  • See also

Code Examples

// @target: esnext

await saveDefaultProps({
  compositionId: "my-composition",
  defaultProps: () => {
    return {
      color: "green",
    };
  },
});
  • What it demonstrates: Usage pattern for saveDefaultProps() from the official docs.

Key Takeaways

  1. Understand examples when working with saveDefaultProps().
  2. Understand unsaveddefaultprops when working with saveDefaultProps().
  3. Understand requirements when working with saveDefaultProps().
  4. Understand see also when working with saveDefaultProps().

Connects To

  • Clipper: related page in the Studio, Player & Editing section.
  • Design Systems: related page in the Studio, Player & Editing section.
  • Editor Starter: related page in the Studio, Player & Editing section.