From 0d4f627f42881202ec92ba581d1b733f91379632 Mon Sep 17 00:00:00 2001 From: ifsnow Date: Mon, 5 Nov 2018 14:20:18 -0800 Subject: [PATCH] Removed unnecessary code in Libraries/Text/Text.js (#22132) Summary: I don't think it's necessary to use spread properties (prevState) in `getDerivedStateFromProps` Pull Request resolved: https://github.com/facebook/react-native/pull/22132 Differential Revision: D12929838 Pulled By: TheSavior fbshipit-source-id: cdc4f9df8e2f0b2878aec605478144b3e08cea89 --- Libraries/Text/Text.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index f1b6c807874f95..72c53b080d137a 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -108,10 +108,12 @@ class TouchableText extends React.Component { responseHandlers: null, }; - static getDerivedStateFromProps(nextProps: Props, prevState: State): ?State { + static getDerivedStateFromProps( + nextProps: Props, + prevState: State, + ): $Shape | null { return prevState.responseHandlers == null && isTouchable(nextProps) ? { - ...prevState, responseHandlers: prevState.createResponderHandlers(), } : null;