createSetup optional props type error
sibbng opened this issue · 1 comments
sibbng commented
https://github.com/antfu/reactivue/blob/master/examples/react-ts-vite/src/basic/createSetup.tsx#L9
This line throws this type error.
Argument of type '(props: Props) => { counter: Ref<number>; doubled: ComputedRef<number>; inc: () => number; }' is not assignable to parameter of type '(props?: Props | undefined) => { counter: Ref<number>; doubled: ComputedRef<number>; inc: () => number; }'.
Types of parameters 'props' and 'props' are incompatible.
Type 'Props | undefined' is not assignable to type 'Props'.
Type 'undefined' is not assignable to type 'Props'.
Related PR #7
I am not sure whether we should solve this issue on the user side or the library side.