From 7be80e96c610930823fdc49a622e1f0089907fcf Mon Sep 17 00:00:00 2001 From: Ademola Date: Sun, 12 Apr 2020 18:17:54 +0100 Subject: [PATCH] docs: make text node type in example more explicit (#4663) --- .../tutorial/10-transitions/05-custom-js-transitions/text.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/tutorial/10-transitions/05-custom-js-transitions/text.md b/site/content/tutorial/10-transitions/05-custom-js-transitions/text.md index da775bbeb3..cc25861c7b 100644 --- a/site/content/tutorial/10-transitions/05-custom-js-transitions/text.md +++ b/site/content/tutorial/10-transitions/05-custom-js-transitions/text.md @@ -8,7 +8,7 @@ While you should generally use CSS for transitions as much as possible, there ar function typewriter(node, { speed = 50 }) { const valid = ( node.childNodes.length === 1 && - node.childNodes[0].nodeType === 3 + node.childNodes[0].nodeType === Node.TEXT_NODE ); if (!valid) { @@ -26,4 +26,4 @@ function typewriter(node, { speed = 50 }) { } }; } -``` \ No newline at end of file +```