Hi,
The Formatter type is defined as follows:
export type Formatter = (
value: number,
unit: Unit,
suffix: Suffix,
epochMilliseconds: number,
nextFormatter: Formatter,
now: () => number,
) => React.ReactNode
Note how the nextFormatter and now parameters are required arguments to Formatter and nextFormatter is declared as a Formatter.
According to the docs and the code, nextFormatter actually takes all the options as optional and will use the prior values if none is provided (or undefined). So the type should be something like:
export type NextFormatter = (
value?: number,
unit?: Unit,
suffix?: Suffix,
epochMilliseconds?: number,
nextFormatter?: Formatter,
now?: () => number,
) => React.ReactNode;
export type Formatter = (
value: number,
unit: Unit,
suffix: Suffix,
epochMilliseconds: number,
nextFormatter: NextFormatter,
now: () => number,
) => React.ReactNode;
Hi,
The
Formattertype is defined as follows:Note how the
nextFormatterandnowparameters are required arguments toFormatterandnextFormatteris declared as aFormatter.According to the docs and the code,
nextFormatteractually takes all the options as optional and will use the prior values if none is provided (or undefined). So the type should be something like: