import React, { memo } from 'react'; import { Handle, useReactFlow, useStoreApi, Position } from 'reactflow'; const options = [ { value: 'smoothstep', label: 'Smoothstep', }, { value: 'step', label: 'Step', }, { value: 'default', label: 'Bezier (default)', }, { value: 'straight', label: 'Straight', }, ]; function Select({ value, handleId, nodeId }) { const { setNodes } = useReactFlow(); const store = useStoreApi(); const onChange = (evt) => { const { nodeInternals } = store.getState(); setNodes( Array.from(nodeInternals.values()).map((node) => { if (node.id === nodeId) { node.data = { ...node.data, selects: { ...node.data.selects, [handleId]: evt.target.value, }, }; } return node; }) ); }; return (
Edge Type
); } function CustomNode({ id, data }) { return ( <>
This is a custom node
{Object.keys(data.selects).map((handleId) => (