Open
Description
Description
Currently when I use useOverlay and pass props it says props is type any.
by adding satisfies InstanceType<typeof COMPONENT>["$props"]
it gets the right types.
But it should work out of the box. Could the typesafety for props be implemented?
current solution
useOverlay()
.create(COMPONENT, {
props: {
id: id,
onUpdated() {
...
},
} satisfies InstanceType<typeof COMPONENT>["$props"],
})
.open();
Additional context
Something like this could create type safety
function createTypedOverlay<T extends new (...args: any) => any>(
component: T,
options: {
props: InstanceType<T>["$props"];
[key: string]: any;
}
) {
return useOverlay().create(component, options);
}