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

Remove UNSAFE_componentWillMount lifecycle methods #611

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ export default class DependencyForceGraph extends Component {
};
}

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,12 @@ type State = {
* Used to render the detail column.
*/
export default class DetailTableData extends Component<Props, State> {
// eslint-disable-next-line camelcase
UNSAFE_componentWillMount() {
constructor(props: Readonly<Props>) {
super(props);
const element = this.props.values.map(item => {
return { uid: _.uniqueId('id'), value: item };
});
this.setState(prevState => {
return {
...prevState,
element,
};
});
this.state = { element };
}

render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,13 @@ type State = {
* Used to render the main column.
*/
export default class MainTableData extends Component<Props, State> {
// eslint-disable-next-line camelcase
UNSAFE_componentWillMount() {
constructor(props: Readonly<Props>) {
super(props);
const element = this.props.values.map(item => {
return { uid: _.uniqueId('id'), value: item };
});

this.setState(prevState => {
return {
...prevState,
element,
};
});
this.state = { element };
}

render() {
Expand Down