-
Notifications
You must be signed in to change notification settings - Fork 525
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
Error when adding props to VictoryZoomVoronoiContainer #1446
Comments
Since this is a typescript error, I think it might be likely an issue with a type definitions. If you think this is an issue with @types/victory, how would you suggest I proceed? |
I don't think any of these props are missing from the type definition for I would guess the issue is with the definition for |
Ok, I can try to get round to having a look this week. Do you know who works on the type definitions so that I can talk to them about it? |
You need to pass both prop types as generic arguments to const VictoryZoomVoronoiContainer = createContainer<VictoryZoomContainerProps, VictoryVoronoiContainerProps>('zoom', 'voronoi'); |
Yeah that has worked - I should have spotted that in the index.d.ts file. Thank you very much! Is there a way this can be documented other than in the index.d.ts file? Or should I add your example to the index.d.ts file to avoid other people making the same mistake as me? |
I'm already using the syntax suggested by @theomg but it doesn't work, any suggestions? Reproduction: https://codesandbox.io/s/basic-victory-example-ig1el |
You are passing the types of the containers themselves instead of their prop types to
instead of
|
Thanks for your help @theomg, It works! |
Hi I am also having this issue but when following the steps given by @theomg I am getting a "Cannot find VictoryVoronoiContainerProps" error. I have tried importing VictoryVoronoiContainerProps as well as VictoryContainerProps with no luck.
Any suggestions? |
@adstew , try to verify the imports, ex:
below an excerpt of the source code that works for me:
|
This works, thank you! I was missing import { VictoryVoronoiContainerProps } from "victory-voronoi-container"; |
I am using same code shown by @adstew but it give error! SyntaxError: Unexpected token (120:111) 120 | const VictoryZoomVoronoiContainer = createContainer<VictoryZoomContainerProps,VictoryVoronoiContainerProps>("zoom", "voronoi"); Any Solution please? |
Closing in favor of #2111 |
Hi - I appreciate this is closed and but am getting this same issue and none of the above fixes appear to work for me. It is all working in production currently on node 16, react 17 using victory I am trying to create a voronoi zoom container
When I create the container I get a type error:
Apologies in advance if this is my fault and is a question best directed elsewhere. |
@eatyourpeas I will open a new issue for this. There are a lot of new types and changes since this original issue, so we can address it separately. #2815 |
Bugs and Questions
Checklist
This is not a
victory-native
specific issue. (Issues that only appear invictory-native
should be opened here)I have read through the FAQ and Guides before asking a question
I am using the latest version of Victory
I've searched open issues to make sure I'm not opening a duplicate issue
The Problem
When using createContainer like so,
Being used in a brush and zoom chart implemented from the example
I receive the following typescript error
Reproduction
https://codesandbox.io/s/basic-victory-example-fzf8i?fontsize=14&hidenavigation=1&theme=dark
The text was updated successfully, but these errors were encountered: