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
This commit is contained in:
ifsnow 2018-11-05 14:20:18 -08:00 коммит произвёл Facebook Github Bot
Родитель f8040ed16f
Коммит 0d4f627f42
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -108,10 +108,12 @@ class TouchableText extends React.Component<Props, State> {
responseHandlers: null,
};
static getDerivedStateFromProps(nextProps: Props, prevState: State): ?State {
static getDerivedStateFromProps(
nextProps: Props,
prevState: State,
): $Shape<State> | null {
return prevState.responseHandlers == null && isTouchable(nextProps)
? {
...prevState,
responseHandlers: prevState.createResponderHandlers(),
}
: null;