From 1d7bd52688aba5edd27d7019bce15180bb0f78aa Mon Sep 17 00:00:00 2001 From: BetaSu <313439271@qq.com> Date: Tue, 14 Apr 2020 21:53:47 +0800 Subject: [PATCH] remove unnecessary variable comparation (#18598) Since it will continue when the props are equal in line 767, there is no need to compare whether they are not equal. --- packages/react-dom/src/client/ReactDOMComponent.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/react-dom/src/client/ReactDOMComponent.js b/packages/react-dom/src/client/ReactDOMComponent.js index 2f0190084b..539d53b781 100644 --- a/packages/react-dom/src/client/ReactDOMComponent.js +++ b/packages/react-dom/src/client/ReactDOMComponent.js @@ -824,10 +824,7 @@ export function diffProperties( // inserted already. } } else if (propKey === CHILDREN) { - if ( - lastProp !== nextProp && - (typeof nextProp === 'string' || typeof nextProp === 'number') - ) { + if (typeof nextProp === 'string' || typeof nextProp === 'number') { (updatePayload = updatePayload || []).push(propKey, '' + nextProp); } } else if (