#Setting width and height in node props (in the initial nodes array) does not work

1 messages · Page 1 of 1 (latest)

sharp shadow
#

nodes: [
{
id: "3",
type: "CustomBaseNode",
data: { label: "NodeResizer2 when selected" },
position: { x: 300, y: 300 },
width: 50,
height: 300,
style: {
background: "#c0c0c0",
border: "2px solid black",
borderRadius: 15,
fontSize: 12,
},
},
]

Everything else works. Width and height don't.

strong parrot
#

width and height are attributes measured by React Flow

#

If you want to set them, you need to use style.width/ height

sharp shadow
#

ok got it. Thx

sharp shadow
#

Hi Moritz but i do not get the full node object in props of a custom node. Style is not present