From 90d280a620c3adb5e83f323882e9cfbcb72c30c7 Mon Sep 17 00:00:00 2001 From: arnoson Date: Sat, 25 Mar 2023 18:40:56 +0100 Subject: [PATCH] fix: don't parse `undefined` closes #5 --- src/props.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/props.ts b/src/props.ts index a32172a..4f48808 100644 --- a/src/props.ts +++ b/src/props.ts @@ -21,8 +21,8 @@ export const createPropsProxy = ( const isConstructor = isBuiltInTypeConstructor(definition) const providesDefault = !isConstructor - if (value === undefined && providesDefault) - return getDefaultProp(definition) + if (value === undefined) + return providesDefault ? getDefaultProp(definition) : undefined const type = isConstructor ? definition.prototype.constructor.name.toLowerCase()