Insert Nodes

1.0.0Last update Dec 8, 2024
by@krishn404

Theis transformation ensures that calls to Transforms.insertNodes in the updated API remain functional and behave identically to their usage in the older API (v0.88) while adhering to the new, more explicit parameterization.

Before (v0.88)

Transforms.insertNodes(editor, newNode);

After (v0.104)

Transforms.insertNodes(editor, newNode, {
at: editor.selection ?? undefined,
select: true,
});

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now