• I try to add a transform which should transform paragraphs to my custom block, what am I doing wrong?

    transforms: {
    from: [
    {
    type: "block",
    priority: 7,
    blocks: ["core/paragraph"],
    transform: function (attributes, innerBlocks) {
    return createBlock("create-block/callout-shadow-box", {
    attributes,
    innerBlocks,
    });
    },
    },
    ],
    to: [
    {
    type: "block",
    blocks: ["core/paragraph"],
    transform: (attributes, innerBlocks) =>
    createBlock("create-block/callout-shadow-box", {
    attributes,
    innerBlocks,
    }),
    },
    ],
    },

    • This topic was modified 2 years, 10 months ago by Ivan Jeremic.
Viewing 1 replies (of 1 total)
  • Hello!

    Can you please share some more info about what’s happening? Does your block report an error on building the code? Or the block code loads fine in the editor but you don’t see the transformations in the UI? Is it the two transformations that are unavailable or is it just one?

    It seems that the second transform function within to uses a different syntax than the first transform within from. You could try to remove the to block and try without that.

    Please let us know if that works ??

Viewing 1 replies (of 1 total)
  • The topic ‘transform with innerBlocks not working’ is closed to new replies.