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:
Родитель
f8040ed16f
Коммит
0d4f627f42
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче