Skip to content

Commit

Permalink
Replaced addTransform with registerNodeTransform in transforms doc (
Browse files Browse the repository at this point in the history
#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

2 comments on commit e690aa2

@vercel
Copy link

@vercel vercel bot commented on e690aa2 Aug 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical – ./packages/lexical-website-new

lexicaljs.com
lexical-fbopensource.vercel.app
lexical.dev
lexical-git-main-fbopensource.vercel.app
www.lexical.dev
lexicaljs.org

@vercel
Copy link

@vercel vercel bot commented on e690aa2 Aug 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical-playground – ./packages/lexical-playground

lexical-playground-fbopensource.vercel.app
lexical-playground.vercel.app
playground.lexical.dev
lexical-playground-git-main-fbopensource.vercel.app

Please sign in to comment.