Commit 3ccc10f8 by Ryan McKinley Committed by Torkel Ödegaard

React: Rename deprecated UNSAFE_componentWillReceiveProps (#18526)

parent 4b344032
...@@ -51,7 +51,7 @@ class PopperController extends React.Component<Props, State> { ...@@ -51,7 +51,7 @@ class PopperController extends React.Component<Props, State> {
}; };
} }
componentWillReceiveProps(nextProps: Props) { UNSAFE_componentWillReceiveProps(nextProps: Props) {
if (nextProps.placement && nextProps.placement !== this.state.placement) { if (nextProps.placement && nextProps.placement !== this.state.placement) {
this.setState((prevState: State) => { this.setState((prevState: State) => {
return { return {
......
...@@ -35,7 +35,7 @@ export class MetricSelect extends React.Component<Props, State> { ...@@ -35,7 +35,7 @@ export class MetricSelect extends React.Component<Props, State> {
this.setState({ options: this.buildOptions(this.props) }); this.setState({ options: this.buildOptions(this.props) });
} }
componentWillReceiveProps(nextProps: Props) { UNSAFE_componentWillReceiveProps(nextProps: Props) {
if (nextProps.options.length > 0 || nextProps.variables.length) { if (nextProps.options.length > 0 || nextProps.variables.length) {
this.setState({ options: this.buildOptions(nextProps) }); this.setState({ options: this.buildOptions(nextProps) });
} }
......
...@@ -33,7 +33,7 @@ export default class ElapsedTime extends PureComponent<Props, State> { ...@@ -33,7 +33,7 @@ export default class ElapsedTime extends PureComponent<Props, State> {
this.setState({ elapsed }); this.setState({ elapsed });
}; };
componentWillReceiveProps(nextProps: Props) { UNSAFE_componentWillReceiveProps(nextProps: Props) {
if (nextProps.time) { if (nextProps.time) {
clearInterval(this.timer); clearInterval(this.timer);
} else if (this.props.time) { } else if (this.props.time) {
......
...@@ -125,7 +125,7 @@ export class QueryField extends React.PureComponent<QueryFieldProps, QueryFieldS ...@@ -125,7 +125,7 @@ export class QueryField extends React.PureComponent<QueryFieldProps, QueryFieldS
} }
} }
componentWillReceiveProps(nextProps: QueryFieldProps) { UNSAFE_componentWillReceiveProps(nextProps: QueryFieldProps) {
if (nextProps.syntaxLoaded && !this.props.syntaxLoaded) { if (nextProps.syntaxLoaded && !this.props.syntaxLoaded) {
// Need a bogus edit to re-render the editor after syntax has fully loaded // Need a bogus edit to re-render the editor after syntax has fully loaded
const change = this.state.value const change = this.state.value
......
...@@ -33,7 +33,7 @@ export class Aggregations extends React.Component<Props, State> { ...@@ -33,7 +33,7 @@ export class Aggregations extends React.Component<Props, State> {
this.setAggOptions(this.props); this.setAggOptions(this.props);
} }
componentWillReceiveProps(nextProps: Props) { UNSAFE_componentWillReceiveProps(nextProps: Props) {
this.setAggOptions(nextProps); this.setAggOptions(nextProps);
} }
......
...@@ -24,7 +24,7 @@ export class AliasBy extends Component<Props, State> { ...@@ -24,7 +24,7 @@ export class AliasBy extends Component<Props, State> {
this.setState({ value: this.props.value }); this.setState({ value: this.props.value });
} }
componentWillReceiveProps(nextProps: Props) { UNSAFE_componentWillReceiveProps(nextProps: Props) {
if (nextProps.value !== this.props.value) { if (nextProps.value !== this.props.value) {
this.setState({ value: nextProps.value }); this.setState({ value: nextProps.value });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment