react-top-loading-bar
react-top-loading-bar copied to clipboard
Wrong TS typings for LoadingBarRef's continuousStart method
Repro: https://codesandbox.io/s/react-top-loading-bar-typing-kxsdn
It seems that the continuousStart typings have recently been updated. The method now requires two mandatory paramters "startingValue" and "refreshRate".
The method's type is currently:
((startingValue: number, refreshRate: number) => void) | undefined
Shouldn't it be:
((startingValue?: number, refreshRate?: number) => void) | undefined
?
Yes, kind of … at least that's what the docs say (both params optional).
But since the method signature is continuousStart(startingValue: number, refreshRate: number = 1000) this should be changed to continuousStart(startingValue?: number, refreshRate: number = 1000) to make method and type match.
https://github.com/klendi/react-top-loading-bar/blob/master/src/index.tsx#L113