From 8688acc36f065ce8510ad8c38019a876ba0fd7e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Exbrayat?= Date: Thu, 14 Nov 2019 17:27:23 +0100 Subject: [PATCH] refactor(runtime-dom): avoid unnecessary checks in patchDOMProp (#452) --- packages/runtime-dom/src/modules/props.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/runtime-dom/src/modules/props.ts b/packages/runtime-dom/src/modules/props.ts index fbaaac2c8e..e723e2c8bd 100644 --- a/packages/runtime-dom/src/modules/props.ts +++ b/packages/runtime-dom/src/modules/props.ts @@ -12,11 +12,15 @@ export function patchDOMProp( ) { if ((key === 'innerHTML' || key === 'textContent') && prevChildren != null) { unmountChildren(prevChildren, parentComponent, parentSuspense) + el[key] = value == null ? '' : value + return } if (key === 'value' && el.tagName !== 'PROGRESS') { // store value as _value as well since // non-string values will be stringified. el._value = value + el.value = value == null ? '' : value + return } if (value === '' && typeof el[key] === 'boolean') { // e.g.