Drag and Drop entity passing but certain values aren't #14
HALAYUDHA-dev
started this conversation in
General
Replies: 1 comment
-
Thank you for the interest to this package🙂. The new version |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I have been using Drag and Drop implementation, and creating a custom node. So the type of new node is caught but label is not passed to the new created node.
Diagram Context
<DiagramContext
settings={{
nodes: {
components: {
batch_node: NodeTemplate,
},
},
ports: {
components: {
batch_to_job: createLinkDefault
},
},
}}
initState={{
nodes: [
{
id: "node_1",
label: "Node 1",
position: [300, 300],
type: "output_horizontal",
},
],
}}
>
DragAndDrop Item
<DragAndDropItem
draggable={node.batchName}
onDrop={createNodeOnDrop({ type: "batch_node", label: "hello"})}
>
{node.batchName}
custom node
**export function NodeTemplate(props) {
return (
<div
className={"react_fast_diagram_NodeDefault"}
style={{
width: 200,
height: 30,
}}
>
{console.log(props.entity.label)}
{props.entity.label}
);
}**
but we can only catch the type but not the passed label
Beta Was this translation helpful? Give feedback.
All reactions