Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update legacy react lifecycle methods to indicate unsafe status #610

Merged
merged 1 commit into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/jaeger-ui/src/components/App/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export class PageImpl extends React.Component<TProps> {
trackPageView(pathname, search);
}

componentWillReceiveProps(nextProps: TProps) {
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps: TProps) {
const { pathname, search } = this.props;
const { pathname: nextPathname, search: nextSearch } = nextProps;
if (pathname !== nextPathname || search !== nextSearch) {
Expand Down
3 changes: 2 additions & 1 deletion packages/jaeger-ui/src/components/DeepDependencies/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export class DeepDependencyGraphPageImpl extends React.PureComponent<TProps, TSt
}
}

componentWillReceiveProps(nextProps: TProps) {
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps: TProps) {
DeepDependencyGraphPageImpl.fetchModelIfStale(nextProps);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export default class DependencyForceGraph extends Component {
};
}

componentWillMount() {
// eslint-disable-next-line camelcase
UNSAFE_componentWillMount() {
this.onResize();
this.debouncedResize = debounce((...args) => this.onResize(...args), 50);
window.addEventListener('resize', this.debouncedResize);
Expand Down
3 changes: 2 additions & 1 deletion packages/jaeger-ui/src/components/DependencyGraph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ export class DependencyGraphPageImpl extends Component {
};
}

componentWillMount() {
// eslint-disable-next-line camelcase
UNSAFE_componentWillMount() {
this.props.fetchDependencies();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ export default class ArchiveNotifier extends React.PureComponent<Props, State> {
this.state = { notifiedState };
}

componentWillReceiveProps(nextProps: Props) {
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps: Props) {
const notifiedState = processProps(this.state.notifiedState, nextProps);
if (this.state.notifiedState !== notifiedState) {
this.setState({ notifiedState });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ export default class SpanGraph extends React.PureComponent<SpanGraphProps, SpanG
};
}

componentWillReceiveProps(nextProps: SpanGraphProps) {
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps: SpanGraphProps) {
const { trace } = nextProps;
if (this.props.trace !== trace) {
this.setState({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ type State = {
* Used to render the detail column.
*/
export default class DetailTableData extends Component<Props, State> {
componentWillMount() {
// eslint-disable-next-line camelcase
UNSAFE_componentWillMount() {
const element = this.props.values.map(item => {
return { uid: _.uniqueId('id'), value: item };
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ type State = {
* Used to render the main column.
*/
export default class MainTableData extends Component<Props, State> {
componentWillMount() {
// eslint-disable-next-line camelcase
UNSAFE_componentWillMount() {
const element = this.props.values.map(item => {
return { uid: _.uniqueId('id'), value: item };
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ export default class TimelineViewingLayer extends React.PureComponent<TimelineVi
this._root = undefined;
}

componentWillReceiveProps(nextProps: TimelineViewingLayerProps) {
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps: TimelineViewingLayerProps) {
const { boundsInvalidator } = this.props;
if (boundsInvalidator !== nextProps.boundsInvalidator) {
this._draggerReframe.resetBounds();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ export class VirtualizedTraceViewImpl extends React.Component<VirtualizedTraceVi
return false;
}

componentWillUpdate(nextProps: VirtualizedTraceViewProps) {
// eslint-disable-next-line camelcase
UNSAFE_componentWillUpdate(nextProps: VirtualizedTraceViewProps) {
const { childrenHiddenIDs, detailStates, registerAccessors, trace, currentViewRangeTime } = this.props;
const {
currentViewRangeTime: nextViewRangeTime,
Expand Down
3 changes: 2 additions & 1 deletion packages/jaeger-ui/src/components/TracePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ export class TracePageImpl extends React.PureComponent<TProps, TState> {
mergeShortcuts(shortcutCallbacks);
}

componentWillReceiveProps(nextProps: TProps) {
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps: TProps) {
const { trace } = nextProps;
this._scrollManager.setTrace(trace && trace.data);
}
Expand Down