Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chart] tooltip slot prop type error #85

Open
techniq opened this issue Jan 11, 2024 · 0 comments
Open

[Chart] tooltip slot prop type error #85

techniq opened this issue Jan 11, 2024 · 0 comments

Comments

@techniq
Copy link
Owner

techniq commented Jan 11, 2024

Currently if you pass the tooltip prop to <Chart> this will wrap the <slot> in a <TooltipContext> which we then use to pass the current value of $tooltip as a slot prop. This is used in a lot of cases including this Area example as well as when in manual mode, such as for Geo, Pie, etc.

ex.

<Chart tooltip let:tooltip>
  ...
</Chart>

Typescript appears to not be able to infer this and throws an error, so we need to find a way to explicitly define this.

@techniq techniq changed the title [Chart]tooltip slot prop type error [Chart] tooltip slot prop type error Jan 11, 2024
mateuszlewko added a commit to mateuszlewko/layerchart that referenced this issue Jan 19, 2024
Passing the same properties indecently of tooltip presence will make it correctly infer types.
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

No branches or pull requests

1 participant