`useObservable` state generic is incorrectly inferred
OliverJAsh opened this issue · 1 comments
OliverJAsh commented
const y = useObservable((input$, state$) => state$, undefined, [1]);
// Actual type: `[number] | undefined`
// Expected type: `undefined`OliverJAsh commented
Only happens when "strictFunctionTypes": false.
Workaround: use explicit generics
const y = useObservable<undefined, [number]>((input$, state$) => state$, undefined, [1]);PR with fix: #176