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

Type Error in Victory Container 36.9.1 #2815

Open
carbonrobot opened this issue Feb 18, 2024 · 3 comments
Open

Type Error in Victory Container 36.9.1 #2815

carbonrobot opened this issue Feb 18, 2024 · 3 comments
Labels
Issue: Accepted The submitted issue has been confirmed by the Victory core team Type: Bug 🐛 Oh no! A bug or unintentional behavior

Comments

@carbonrobot
Copy link
Contributor

I am using victory 36.9.1 and react 18.2 in node 20

It is all working in production currently on node 16, react 17 using victory 35.4.8

I am trying to create a voronoi zoom container

import { VictoryVoronoiContainerProps } from 'victory-voronoi-container';
import { VictoryZoomContainerProps } from 'victory-zoom-container';

When I create the container I get a type error:

const VictoryZoomVoronoiContainer = createContainer<VictoryZoomContainerProps, VictoryVoronoiContainerProps>(
    'zoom',
    'voronoi',
);
Expected 0 type arguments, but got 2.ts(2558)

Apologies in advance if this is my fault and is a question best directed elsewhere.

Originally posted by @eatyourpeas in #1446 (comment)

@KenanYusuf
Copy link
Member

The types for this function have been rewritten here #2799

@eatyourpeas
Copy link
Contributor

eatyourpeas commented Feb 20, 2024

In fact I managed to get this working in the end with this (note, breaks without the any):

// allows two top level containers: zoom and voronoi
const VictoryZoomVoronoiContainer:any = createContainer(
    'zoom',
    'voronoi',
);

Feels like I have not understood the types magic that is going on here, but this works for me for the moment, unless there is some better way I should do this.

@carbonrobot carbonrobot added Type: Bug 🐛 Oh no! A bug or unintentional behavior Issue: Accepted The submitted issue has been confirmed by the Victory core team labels Feb 22, 2024
@napmn
Copy link

napmn commented Mar 4, 2024

to get the same type as before the change that broke this you can temporarily use

const VictoryZoomVoronoiContainer = createContainer('zoom', 'voronoi') as React.ComponentType<
  VictoryVoronoiContainerProps & VictoryZoomContainerProps
>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Accepted The submitted issue has been confirmed by the Victory core team Type: Bug 🐛 Oh no! A bug or unintentional behavior
Projects
None yet
Development

No branches or pull requests

4 participants