mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 20:25:33 +08:00
Ran rename-unsafe-lifecycles codemod on xplat/js
Reviewed By: trueadm Differential Revision: D6889214 fbshipit-source-id: e815cda4b09f3650ae3b0b9a44ae6f5fcb48fe25
This commit is contained in:
committed by
Facebook Github Bot
parent
fa334ce464
commit
6f007e8957
@@ -423,11 +423,11 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
||||
}
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UNSAFE_componentWillMount() {
|
||||
this._checkProps(this.props);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps: Props<ItemT>) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps: Props<ItemT>) {
|
||||
invariant(
|
||||
nextProps.numColumns === this.props.numColumns,
|
||||
'Changing numColumns on the fly is not supported. Change the key prop on FlatList when ' +
|
||||
|
||||
@@ -354,7 +354,7 @@ var ListView = createReactClass({
|
||||
return this._scrollComponent.getInnerViewNode();
|
||||
},
|
||||
|
||||
componentWillMount: function() {
|
||||
UNSAFE_componentWillMount: function() {
|
||||
// this data should never trigger a render pass, so don't put in state
|
||||
this.scrollProperties = {
|
||||
visibleLength: null,
|
||||
@@ -375,7 +375,7 @@ var ListView = createReactClass({
|
||||
});
|
||||
},
|
||||
|
||||
componentWillReceiveProps: function(nextProps: Object) {
|
||||
UNSAFE_componentWillReceiveProps: function(nextProps: Object) {
|
||||
if (
|
||||
this.props.dataSource !== nextProps.dataSource ||
|
||||
this.props.initialListSize !== nextProps.initialListSize
|
||||
|
||||
@@ -135,7 +135,7 @@ class MetroListView extends React.Component<Props, $FlowFixMeState> {
|
||||
}),
|
||||
sectionHeaderData: {},
|
||||
});
|
||||
componentWillReceiveProps(newProps: Props) {
|
||||
UNSAFE_componentWillReceiveProps(newProps: Props) {
|
||||
this.setState(state => this._computeState(newProps, state));
|
||||
}
|
||||
render() {
|
||||
|
||||
@@ -611,7 +611,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||
this._fillRateHelper.deactivateAndFlush();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps: Props) {
|
||||
UNSAFE_componentWillReceiveProps(newProps: Props) {
|
||||
const {data, extraData, getItemCount, maxToRenderPerBatch} = newProps;
|
||||
// first and last could be stale (e.g. if a new, shorter items props is passed in), so we make
|
||||
// sure we're rendering a reasonable range here.
|
||||
|
||||
@@ -361,7 +361,7 @@ class VirtualizedSectionList<SectionT: SectionBase> extends React.PureComponent<
|
||||
this.state = this._computeState(props);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps: Props<SectionT>) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps: Props<SectionT>) {
|
||||
this.setState(this._computeState(nextProps));
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ class ItemWithSeparator extends React.Component<
|
||||
},
|
||||
};
|
||||
|
||||
componentWillReceiveProps(props: ItemWithSeparatorProps) {
|
||||
UNSAFE_componentWillReceiveProps(props: ItemWithSeparatorProps) {
|
||||
this.setState(state => ({
|
||||
separatorProps: {
|
||||
...this.state.separatorProps,
|
||||
|
||||
Reference in New Issue
Block a user