victory
victory copied to clipboard
Typescript returns an error due to `datum` not being in `CoordinatesPropType`
Describe the bug
CoordinatesPropType, as passed to the method used in cursorLabel, contains a datum member; however it seems to be missing in the type definition, and this causes Typescript to experience compilation errors.
Victory version NPM: 8.15.1 Victory: 36.5.3
To Reproduce
- Create a Typescript project using Victory
- Create a
VictoryChartobject containing aVictoryCursorContainerone - Set the
VictoryCursorContainerpropertycursorLabelwith a function like({ datum }) =>${datum.x}`
Expected behavior
This should compile and work well, but it fails due to datum not being found as part of CoordinatesPropType.
Desktop (please complete the following information):
- OS: Windows 11
- Browser: Chrome
- Version: 103
Additional context
Currently using a project initialised with create-react-app.
Our type definition for this prop was incorrect, and has been fixed in #2419 👍 Thanks for finding this!
Fixed in 36.6.1 👍