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

ref is not generic #58

Closed
kristof-mattei opened this issue Feb 19, 2024 · 1 comment
Closed

ref is not generic #58

kristof-mattei opened this issue Feb 19, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@kristof-mattei
Copy link
Contributor

ref is not generic

ref is not generic. This causes a mismatch between ref={setSigma} and the actual type of setSigma.

We give it setSigma: React.Dispatch<React.SetStateAction<Sigma<MyGraph> | null>>

but the ref enforces setSigma: React.Dispatch<React.SetStateAction<Sigma<AbstractGraph<Attributes, Attributes, Attributes>> | null>>

React-sigma-v2: 3.4.2
Sigma.js version: 2.4.0
Graphology version: 0.25.4
Operating System: LG Laundry machine OS
Web browser: Edge 120.0.0

Steps to reproduce

Check the live example https://codesandbox.io/p/sandbox/react-sigma-example-forked-9mks58?file=%2Fsrc/App.tsx

Expected behavior

I can use setSigma with custom graph type so I can get better intellisense

Actual behavior

Computer says no:

image

Note

If the issue has an inactivity of 30 days, it becomes stale.
With an additional inactivity of 14 days, the issue is closed

@sim51
Copy link
Owner

sim51 commented Apr 4, 2024

Done with the latest version of sigma (ie. the v3).
Take a look here : https://github.com/sim51/react-sigma/blob/main/packages/storybook/stories/External.tsx#L13

@sim51 sim51 closed this as completed Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants