Move state update listeners from constructor to componentDidMount (#28341)
* Move state update listeners from constructor to componentDidMount Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
committed by
GitHub
parent
2d9982f9f0
commit
0899165d9e
@@ -64,6 +64,11 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
|
||||
|
||||
this.unmounted = false;
|
||||
this.issueRef = React.createRef();
|
||||
}
|
||||
|
||||
public componentDidMount(): void {
|
||||
this.unmounted = false;
|
||||
this.issueRef.current?.focus();
|
||||
|
||||
// Get all of the extra info dumped to the console when someone is about
|
||||
// to send debug logs. Since this is a fire and forget action, we do
|
||||
@@ -76,10 +81,6 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
|
||||
});
|
||||
}
|
||||
|
||||
public componentDidMount(): void {
|
||||
this.issueRef.current?.focus();
|
||||
}
|
||||
|
||||
public componentWillUnmount(): void {
|
||||
this.unmounted = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user