Skip to content

🎥 Make videos programmatically with React

Update validate-default-props.ts

Jonny Burgerb8277404f8a2
diff --git a/packages/core/src/validation/validate-default-props.ts b/packages/core/src/validation/validate-default-props.ts
index 159764b576..00b02d37d4 100644
--- a/packages/core/src/validation/validate-default-props.ts
+++ b/packages/core/src/validation/validate-default-props.ts
@@ -6,9 +6,13 @@ export const validateDefaultAndInputProps = (
return;
}
- if (defaultProps !== 'object') {
+ if (typeof defaultProps !== 'object') {
throw new Error(
`"${name}" must be an object, but you passed a value of type ${typeof defaultProps}`
);
}
+
+ if (Array.isArray(defaultProps)) {
+ throw new Error(`"${name}" must be an object, but you passed an array`);
+ }
};