message: Monitoring: Convert PollerPages to a functional component
diff: @@ -993,8 +993,8 @@ const CreateSilence = () => {
  : <SilenceForm defaults={{matchers}} saveButtonText="Create" title="Silence Alert" />;
  };
  -class PollerPages extends React.Component<null, null> {
  - componentDidMount() {
  +const PollerPages = () => {
  + React.useEffect(() => {
  const poll = (url: string, key: 'alerts' | 'silences', dataHandler: (data: any[]) => any): void => {
  store.dispatch(UIActions.monitoringLoading(key));
  const poller = (): void => {
  @@ -1050,13 +1050,10 @@ class PollerPages extends React.Component<null, null> {
  } else {
  store.dispatch(UIActions.monitoringErrored('silences', new Error('alertManagerBaseURL not set')));
  }
  - }
  - componentWillUnmount() {
  - _.each(pollerTimeouts, clearTimeout);
  - }
  + return () => _.each(pollerTimeouts, clearTimeout);
  + }, []);
  - render() {
  return <Switch>
  <Route path="/monitoring/alerts" exact component={AlertsPage} />
  <Route path="/monitoring/alerts/:ruleID" exact component={AlertsDetailsPage} />
  @@ -1065,8 +1062,7 @@ class PollerPages extends React.Component<null, null> {
  <Route path="/monitoring/silences/:id" exact component={SilencesDetailsPage} />
  <Route path="/monitoring/silences/:id/edit" exact component={EditSilence} />
  </Switch>;
  - }
  -}
  +};
  export const MonitoringUI = () => <Switch>
  <Redirect from="/monitoring" exact to="/monitoring/alerts" />
  