Closed dsebastien closed 2 years ago
It's weird, the project compiles without warning, but it's true that NodeKey
is not defined in the index.ts
... I need to check that.
Tthe hover node in the example should be const [hoveredNode, setHoveredNode] = useState<NodeKey | null>(null);
And fill free to make a PR with your improvments !
It's because the TS configuration is very lenient atm (check my commits to see how I've made it stricter). I'll send a PR later today
I've adapted the examples based on what you told me. They still seem to work fine ;-)
Thanks a lot ! TS is much better now :)
Hello there!
I'm interested in contributing a few TypeScript improvements to this project, as I plan on using it for a PoC.
I have already forked the project and made some changes for better type safety: https://github.com/dsebastien/react-sigma-v2/commits/main
One thing that is not clear for me is this: https://github.com/sim51/react-sigma-v2/blob/main/src/index.ts#L21
Can you tell me what
NodeKey
is supposed to be? It's not defined at the moment it seems. For now I've tried usingimport { NodeKey } from "graphology-types";
, which is in factstring | number
, but then I get errors in thecomplete.tsx
example, where the code always expects thehoveredNode
state to be astring
.