title: How to set state of component in Signalr connection.on()
body: <p>I want to get data from server with signalr and update content of React component. Everything is ok. Data is received from the server BUT state of component could not update (undefined).  </p>
  
  <p>Here is my code:</p>
  
  <pre><code>import React, { Component } from 'react';
  import { ToastComponent } from '@syncfusion/ej2-react-notifications';
  import * as signalR from '@aspnet/signalr';
  
  
  class Notification extends React.Component {
  
      constructor() {
          super(...arguments);
          this.position = { X: 'Right', Y: 'Top' }
          this.state = { message:null}
  
      }
  
      toastCreated() {
          this.toastInstance.show({ timeOut:0 })
      }
  
      componentWillMount() {
          const notifConn = new signalR.HubConnectionBuilder().withUrl("/notif").build();
          notifConn.on("ReceiveMessage", function (msg) {
              this.setState = ({ message: msg })
  
          });
          notifConn.start().then(function () {
              notifConn.invoke("SendNotification");
  
          }).catch(function (er) {
              console.log(er.toString());
          });
  
  
      }
  </code></pre>