diff --git a/.changeset/fair-guests-hide.md b/.changeset/fair-guests-hide.md new file mode 100644 index 00000000..48934797 --- /dev/null +++ b/.changeset/fair-guests-hide.md @@ -0,0 +1,5 @@ +--- +"@playcanvas/react": patch +--- + +Include nullish props in component schema diff --git a/packages/lib/src/utils/validation.ts b/packages/lib/src/utils/validation.ts index 8406d347..916dc4b4 100644 --- a/packages/lib/src/utils/validation.ts +++ b/packages/lib/src/utils/validation.ts @@ -494,6 +494,15 @@ export function createComponentDefinition( default: value, errorMsg: (val) => `Invalid value for prop "${String(key)}": "${JSON.stringify(val)}". Expected a Material.`, }; + } else if(value === null) { + schema[key] = { + validate: () => true, + default: value, + errorMsg: () => '', + apply: (instance, props, key) => { + (instance[key as keyof InstanceType] as unknown) = props[key]; + } + }; } });