Make optional components handle false-y values better

This commit is contained in:
thepaperpilot 2022-12-18 01:43:02 -06:00
parent 5f1b2e7178
commit 65fbeb73ff

View file

@ -229,7 +229,7 @@ export function computeOptionalComponent(
const comp = shallowRef<Component | "" | null>(null);
watchEffect(() => {
const currComponent = unwrapRef(component);
comp.value = currComponent == null ? null : coerceComponent(currComponent, defaultWrapper);
comp.value = !currComponent ? null : coerceComponent(currComponent, defaultWrapper);
});
return comp;
}