Skip to content

Commit

Permalink
Replaced addTransform with registerNodeTransform in transforms doc (
Browse files Browse the repository at this point in the history
facebook#2882)

`addTransform` was renamed a couple of times (first to `addNodeTransform` then `registerNodeTransform`) but the doc page on transforms still referenced the original naming.
  • Loading branch information
kevinansfield authored Aug 24, 2022
1 parent 505eb92 commit e690aa2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/lexical-website-new/docs/concepts/transforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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(() => {
Expand Down

0 comments on commit e690aa2

Please sign in to comment.