From e690aa2a1e1b676d0268c2347b63e61a54369df7 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 24 Aug 2022 15:02:22 +0100 Subject: [PATCH] Replaced `addTransform` with `registerNodeTransform` in transforms doc (#2882) `addTransform` was renamed a couple of times (first to `addNodeTransform` then `registerNodeTransform`) but the doc page on transforms still referenced the original naming. --- packages/lexical-website-new/docs/concepts/transforms.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/lexical-website-new/docs/concepts/transforms.md b/packages/lexical-website-new/docs/concepts/transforms.md index 8fea5efdb5c..382e0114d6a 100644 --- a/packages/lexical-website-new/docs/concepts/transforms.md +++ b/packages/lexical-website-new/docs/concepts/transforms.md @@ -92,9 +92,9 @@ Transforms are very specific to a type of node. This applies to both the declara ```js // Won't trigger -editor.addTransform(ParagraphNode, ..) +editor.registerNodeTransform(ParagraphNode, ..) // Will trigger as TextNode was marked dirty -editor.addTransform(TextNode, ..) +editor.registerNodeTransform(TextNode, ..) editor.update(() => { const textNode = $getNodeByKey('3'); textNode.setTextContent('foo'); @@ -107,7 +107,7 @@ You remove a node, its parent is marked dirty, also the node's immediate sibling You move a node via `replace`, rules 2 and 1 are applied. ```js -editor.addTransform(ParagraphNode, paragraph => { +editor.registerNodeTransform(ParagraphNode, paragraph => { // Triggers }); editor.update(() => {