Add componentDidMount for initial render

This commit is contained in:
Sung-Hyun Kang 2024-06-17 14:19:23 -05:00
parent f7b7d135df
commit 7cf0eb511a
2 changed files with 4 additions and 1 deletions

View File

@ -57,6 +57,10 @@ export class NotificationConsoleComponent extends React.Component<
this.prevHeaderStatus = undefined; this.prevHeaderStatus = undefined;
} }
public componentDidMount() {
this.componentDidUpdate(this.props, this.state);
}
public componentDidUpdate( public componentDidUpdate(
prevProps: NotificationConsoleComponentProps, prevProps: NotificationConsoleComponentProps,
prevState: NotificationConsoleComponentState, prevState: NotificationConsoleComponentState,

View File

@ -11,7 +11,6 @@ function log(type: ConsoleDataType, message: string): () => void {
}).format(new Date()); }).format(new Date());
useNotificationConsole.getState().setNotificationConsoleData({ type, date, message, id }); useNotificationConsole.getState().setNotificationConsoleData({ type, date, message, id });
console.log(message, id);
return () => useNotificationConsole.getState().setInProgressConsoleDataIdToBeDeleted(id); return () => useNotificationConsole.getState().setInProgressConsoleDataIdToBeDeleted(id);
} }