Bug report for microsoft/TypeScript#29958
- yarn
- see the index.tsx
expect typeof factory to be
(eventSource$: Observable<MouseEvent<HTMLButtonElement, MouseEvent>>, inputs$: Observable<number[]>, state$: Observable<number>) => Observable<number>
but TypeScript inference the factory type to be
(eventSource$: Observable<MouseEvent<HTMLButtonElement, MouseEvent>>, inputs$: Observable<number[]>, state$: Observable<number[]>) => Observable<number[]>
while the State
of useEventCallback<EventValue, State, Inputs>
expect to be the typeof initialValue
which in parameters
Downgrade to typescript 3.1.6
, this bug disappear.