reactchartjs/react-chartjs-2

[Bug]: stepped option is only accepting true

Opened this issue · 1 comments

Would you like to work on a fix?

  • Check this if you would like to implement a PR, we are more than happy to help you go through the process.

Current and expected behavior

When using the stepped option for a dataset, Typescript only allows true | false as a valid value despite showing the valid strings from the documentation as an option.

It should accept the options "before" | "after" | "middle" as valid options as strings.

Reproduction

https://codesandbox.io/p/devbox/compassionate-brahmagupta-npxf8t?file=%2FApp.tsx%3A52%2C16

chart.js version

v4.4.3

react-chartjs-2 version

v5.2.0

Possible solution

No response

Funny thing is, that it works, when one specifies the string as const, i.e.

...
stepped: 'after' as const, // leads to no error
...