Move code out of deprecated componentWillMount()

> warning: Warning: componentWillMount has been renamed, and is not
recommended for use. See https://fb.me/react-unsafe-component-lifecycles
for details.

* Move code with side effects to componentDidMount, and set initial
state in the constructor
This commit is contained in:
Justin Stephenson 2020-04-27 16:30:56 -04:00
parent 5a6e0beb53
commit 6a7f6805d9
3 changed files with 14 additions and 19 deletions

View file

@ -181,7 +181,7 @@ class Config extends React.Component {
this.setState({file_error: reason});
}
componentWillMount() {
componentDidMount() {
this.getConfig();
this.readConfig();
}
@ -393,7 +393,7 @@ class SssdConfig extends React.Component {
}
}
componentWillMount() {
componentDidMount() {
let syntax_object = {
parse: ini.parse,
stringify: ini.stringify