How to set the 3 different color to useState when the page loads
Unanswered
Thai posted this in #help-forum
ThaiOP
the viewSubetColor has the list [
{
"id": "dndnode_0",
"type": "regionCustomNode",
"data": { "label": "input node" },
"position": { "x": 850, "y": 5 },
"width": 1200,
"height": 1050
},
{
"id": "dndnode_1",
"type": "vpcComponent",
"position": { "x": 40, "y": 50 },
"parentNode": "dndnode_0",
"extent": "parent",
"width": 1120,
"height": 970
},
{
"id": "dndnode_2",
"type": "subnetComponent",
"position": { "x": 105, "y": 65 },
"parentNode": "dndnode_4",
"extent": "parent",
"width": 200,
"height": 250,
"selected": false,
"dragging": false
},
{
"id": "dndnode_3",
"type": "subnetComponent",
"position": { "x": 105, "y": 70 },
"parentNode": "dndnode_5",
"extent": "parent",
"width": 200,
"height": 250,
"selected": false,
"dragging": false
},
{
"id": "dndnode_4",
"type": "zoneComponent",
"position": { "x": 50, "y": 60 },
"parentNode": "dndnode_1",
"extent": "parent",
"width": 1020,
"height": 370
},
{
"id": "dndnode_8",
"type": "subnetComponent",
"position": { "x": 450, "y": 125 },
"parentNode": "dndnode_1",
"extent": "parent",
"width": 200,
"height": 250
},
{
"id": "dndnode_13",
"type": "subnetComponent",
"position": { "x": 750, "y": 125 },
"parentNode": "dndnode_1",
"extent": "parent",
"width": 200,
"height": 250
},
{
"id": "dndnode_14",
"type": "subnetComponent",
"position": { "x": 750, "y": 650 },
"parentNode": "dndnode_1",
"extent": "parent",
"width": 200,
"height": 250
},
]
the color of the subnetColor to be only set for the id dndnode_2 ,dndnode_3 ,dndnode_8 dndnode_13 and dndnode_14
{
"id": "dndnode_0",
"type": "regionCustomNode",
"data": { "label": "input node" },
"position": { "x": 850, "y": 5 },
"width": 1200,
"height": 1050
},
{
"id": "dndnode_1",
"type": "vpcComponent",
"position": { "x": 40, "y": 50 },
"parentNode": "dndnode_0",
"extent": "parent",
"width": 1120,
"height": 970
},
{
"id": "dndnode_2",
"type": "subnetComponent",
"position": { "x": 105, "y": 65 },
"parentNode": "dndnode_4",
"extent": "parent",
"width": 200,
"height": 250,
"selected": false,
"dragging": false
},
{
"id": "dndnode_3",
"type": "subnetComponent",
"position": { "x": 105, "y": 70 },
"parentNode": "dndnode_5",
"extent": "parent",
"width": 200,
"height": 250,
"selected": false,
"dragging": false
},
{
"id": "dndnode_4",
"type": "zoneComponent",
"position": { "x": 50, "y": 60 },
"parentNode": "dndnode_1",
"extent": "parent",
"width": 1020,
"height": 370
},
{
"id": "dndnode_8",
"type": "subnetComponent",
"position": { "x": 450, "y": 125 },
"parentNode": "dndnode_1",
"extent": "parent",
"width": 200,
"height": 250
},
{
"id": "dndnode_13",
"type": "subnetComponent",
"position": { "x": 750, "y": 125 },
"parentNode": "dndnode_1",
"extent": "parent",
"width": 200,
"height": 250
},
{
"id": "dndnode_14",
"type": "subnetComponent",
"position": { "x": 750, "y": 650 },
"parentNode": "dndnode_1",
"extent": "parent",
"width": 200,
"height": 250
},
]
the color of the subnetColor to be only set for the id dndnode_2 ,dndnode_3 ,dndnode_8 dndnode_13 and dndnode_14