Skip to content

fix(line): correct pointSymbol datum type to match runtime data#2824

Open
restareaByWeezy wants to merge 1 commit intoplouc:masterfrom
restareaByWeezy:fix/line-point-symbol-type
Open

fix(line): correct pointSymbol datum type to match runtime data#2824
restareaByWeezy wants to merge 1 commit intoplouc:masterfrom
restareaByWeezy:fix/line-point-symbol-type

Conversation

@restareaByWeezy
Copy link

Closes #2818

The pointSymbol prop was typed as DotsItemSymbolComponent<Point<Series>>, but at runtime the datum passed to the symbol component is actually Point<Series>['data'] (i.e. the raw data item), not the full Point object. You can see this in Points.tsx where datum: point.data is mapped before passing to DotsItem.

Changed the type to DotsItemSymbolComponent<Point<Series>['data']> so datum.stalled (or whatever custom fields are on the data) is correctly typed without needing datum.data.stalled.

Also removed the as any cast on the symbol prop in Points.tsx since the types now line up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mismatching type for pointSymbol from ResponsiveLine

1 participant