I am trying to update the puck state via json 👇.
Every key and id is unique(uinqueId values are uniquely generated while preparing the json).
This is how i am updating the state it dispatch({ type: "setData", data: newData })
{
"zones": {},
"root": { "props": { "title": "Some site" } },
"content": [
{
"type": "body", "key": "uniqueId", "id": "uniqueId", "props": {
"data-template": "true",
"items": [
{
"type": "div", "key": "uniqueId", "id": "uniqueId", "props": {
"items": [
{
"type": "h1", "key": "uniqueId", "id": "uniqueId", "props": {
"items": [{
"type": "textString",
"props": { "id": "uniqueId", "children": "Example Domain" }
}]
}
},
{
"type": "p", "key": "uniqueId", "id": "uniqueId", "props": {
"items": [{
"type": "textString",
"props": { "id": "uniqueId", "children": "Some Text" }
}]
}
},
{
"type": "p", "key": "uniqueId", "id": "uniqueId", "props": {
"items": [
{
"type": "a", "key": "uniqueId", "id": "uniqueId", "props": {
"href": "https://www.iana.org/domains/example",
"items": [
{
"type": "textString", "key": "uniqueId", "id": "uniqueId",
"props": { "id": "uniqueId", "children": "More information..." }
}
]
}
}
]
}
}
]
}
}
]
}
}
]
}