From 6ebd45102ec6550c21e11ba9078c21ae132e3782 Mon Sep 17 00:00:00 2001 From: * <8> Date: Sat, 19 Feb 2022 16:02:34 +0800 Subject: [PATCH] Match-id-6bb47c987ac6a5af06a8bc3190968fa7f051b4b3 --- libs/horizon/src/dom/DOMOperator.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/horizon/src/dom/DOMOperator.ts b/libs/horizon/src/dom/DOMOperator.ts index f82eb803..bb061fa7 100644 --- a/libs/horizon/src/dom/DOMOperator.ts +++ b/libs/horizon/src/dom/DOMOperator.ts @@ -123,11 +123,11 @@ export function getPropChangeList( } export function isTextChild(type: string, props: Props): boolean { - const typeArray = ['textarea', 'option', 'noscript']; - const typeOfPropsChild = ['string', 'number']; - if (typeArray.indexOf(type) >= 0) { + if (type === 'textarea' || type === 'option' || type === 'noscript') { return true; - } else if (typeOfPropsChild.indexOf(typeof props.children) >= 0) { + } + const childType = typeof props.children; + if (childType === 'string' || childType === 'number') { return true; } else { return (