We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I've tried to use a basic example, then switch to FC approach, but simple graph app still fails.
Here is a code:
import React, {useRef, useCallback, FC} from 'react'; import CytoscapeComponent from 'react-cytoscapejs'; import type cytoscape from 'cytoscape'; export const СytoscapeGraph: FC = () => { const cy = useRef<cytoscape.Core | null>(null); const setCytoscape = useCallback( (ref: cytoscape.Core) => { cy.current = ref; }, [cy], ); const data = { nodes: [ { data: { id: 'one', label: 'Node 1' }, position: { x: 0, y: 0 } }, { data: { id: 'two', label: 'Node 2' }, position: { x: 100, y: 0 } } ], edges: [ { data: { source: 'one', target: 'two', label: 'Edge from Node1 to Node2' } } ] } const elements = CytoscapeComponent.normalizeElements(data); return ( <CytoscapeComponent cy={setCytoscape} elements={elements} /> ); } export default СytoscapeGraph;
And I've got:
The text was updated successfully, but these errors were encountered:
Had this issue after migrating from webpack 4 to 5. Turned out it was caused by this webpack setting:
{ resolve: { modules: ['node_modules', 'src'] } }
Fixed by removing the setting
Sorry, something went wrong.
No branches or pull requests
I've tried to use a basic example, then switch to FC approach, but simple graph app still fails.
Here is a code:
And I've got:
The text was updated successfully, but these errors were encountered: