Skip to content

Commit

Permalink
tweak comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alicewriteswrongs committed Apr 3, 2024
1 parent 405e8a8 commit 78f163f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/compiler/transformers/automatic-key-insertion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ export const performAutomaticKeyInsertion = (transformCtx: ts.TransformationCont
// ```
//
// Since the `<div>` tags don't have `key` attributes the Stencil vdom will
// re-used the same div element between re-renders, and will just swap out
// the children (the text nodes in this case). If our key insertion transformer
// put unique keys onto each tag then this wouldn't happen any longer.
// re-use the same div element between re-renders, and will just swap out
// the children (the text nodes in this case). If our key insertion
// transformer put unique keys onto each tag then this wouldn't happen any
// longer.
if (ts.isMethodDeclaration(node) && node.name.getText() === 'render' && numReturnStatements(node) === 1) {
return ts.visitEachChild(node, jsxElementVisitor, transformCtx);
} else {
Expand Down

0 comments on commit 78f163f

Please sign in to comment.