Skip to content

🎥 Make videos programmatically with React

Zod: use `input` and `output` instead of `infer`

Jonny Burger9bd9ac21a76b
diff --git a/packages/core/src/Composition.tsx b/packages/core/src/Composition.tsx
index 53d8087fa4..c759184b34 100644
--- a/packages/core/src/Composition.tsx
+++ b/packages/core/src/Composition.tsx
@@ -193,7 +193,7 @@ export const Composition = <
id,
folderName,
component: lazy,
- defaultProps: defaultProps as z.infer<Schema> & Props,
+ defaultProps: defaultProps as z.output<Schema> & Props,
nonce,
parentFolderName: parentName,
schema: schema ?? null,
diff --git a/packages/core/src/props-if-has-props.ts b/packages/core/src/props-if-has-props.ts
index 3b1ea46c76..e187277d6a 100644
--- a/packages/core/src/props-if-has-props.ts
+++ b/packages/core/src/props-if-has-props.ts
@@ -33,6 +33,6 @@ export type InferProps<
Props
: {} extends Props
? // Only schema specified
- z.infer<Schema>
+ z.input<Schema>
: // Props and schema specified
- z.infer<Schema> & Props;
+ z.input<Schema> & Props;
diff --git a/packages/player/src/utils/props-if-has-props.ts b/packages/player/src/utils/props-if-has-props.ts
index 1539241bb9..22a7af9436 100644
--- a/packages/player/src/utils/props-if-has-props.ts
+++ b/packages/player/src/utils/props-if-has-props.ts
@@ -7,7 +7,7 @@ export type PropsIfHasProps<
? {} extends Props
? {
// Neither props nor schema specified
- inputProps?: z.infer<Schema> & Props;
+ inputProps?: z.input<Schema> & Props;
}
: {
// Only props specified
@@ -16,9 +16,9 @@ export type PropsIfHasProps<
: {} extends Props
? {
// Only schema specified
- inputProps: z.infer<Schema>;
+ inputProps: z.input<Schema>;
}
: {
// Props and schema specified
- inputProps: z.infer<Schema> & Props;
+ inputProps: z.input<Schema> & Props;
};