mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-26 13:25:51 +08:00
Fix usages of ReactComponentWithPureRenderMixin
Summary: Closes https://github.com/facebook/react-native/pull/13111 Differential Revision: D4761971 Pulled By: davidaurelio fbshipit-source-id: 668dcc58e8e1b075ee760233abc6904beede9218
This commit is contained in:
committed by
Facebook Github Bot
parent
720e19525e
commit
a2cfea1934
@@ -37,7 +37,6 @@ const NavigationHeaderStyleInterpolator = require('NavigationHeaderStyleInterpol
|
|||||||
const NavigationHeaderTitle = require('NavigationHeaderTitle');
|
const NavigationHeaderTitle = require('NavigationHeaderTitle');
|
||||||
const NavigationPropTypes = require('NavigationPropTypes');
|
const NavigationPropTypes = require('NavigationPropTypes');
|
||||||
const React = require('React');
|
const React = require('React');
|
||||||
const ReactComponentWithPureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin');
|
|
||||||
const ReactNative = require('react-native');
|
const ReactNative = require('react-native');
|
||||||
const TVEventHandler = require('TVEventHandler');
|
const TVEventHandler = require('TVEventHandler');
|
||||||
|
|
||||||
@@ -82,7 +81,7 @@ const APPBAR_HEIGHT = Platform.OS === 'ios' ? 44 : 56;
|
|||||||
const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 20 : 0;
|
const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 20 : 0;
|
||||||
const {PropTypes} = React;
|
const {PropTypes} = React;
|
||||||
|
|
||||||
class NavigationHeader extends React.Component<DefaultProps, Props, any> {
|
class NavigationHeader extends React.PureComponent<DefaultProps, Props, any> {
|
||||||
props: Props;
|
props: Props;
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
@@ -121,14 +120,6 @@ class NavigationHeader extends React.Component<DefaultProps, Props, any> {
|
|||||||
viewProps: PropTypes.shape(View.propTypes),
|
viewProps: PropTypes.shape(View.propTypes),
|
||||||
};
|
};
|
||||||
|
|
||||||
shouldComponentUpdate(nextProps: Props, nextState: any): boolean {
|
|
||||||
return ReactComponentWithPureRenderMixin.shouldComponentUpdate.call(
|
|
||||||
this,
|
|
||||||
nextProps,
|
|
||||||
nextState
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
_tvEventHandler: TVEventHandler;
|
_tvEventHandler: TVEventHandler;
|
||||||
|
|
||||||
componentDidMount(): void {
|
componentDidMount(): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user