title: How to bind and call method of c# obejct in React component class
body: <p>I am having a Cefsharp container in which I am loading a react app hosted on my local node server. I have regeisterd a c# object in my .net project as shown below:-</p>
  
  <pre><code>
  browser.JavascriptObjectRepository.Register("bound", new Client(), isAsync: true, options: BindingOptions.DefaultBinder);
  
  </code></pre>
  
  <p>now in one of my react component class I want to refer a method of that C# object. What I am doing is I am trying to access that using </p>
  
  <pre><code>componentWillMount() {
      this.invoke();
    }
  
    async invoke() {
      const message = await window.bound.message();
      this.setState({selectedItem: message});
    }
  </code></pre>
  
  <p>And here is my C# object:-</p>
  
  <pre><code>public class Client
      {
          public string Id { get; set; }
          public string Name { get; set; }
  
          public string Message()
          {
              return "ClientABCD";
          }
      }
  </code></pre>
  
  <p>But this is not working. I am getting "bound is not defined error". I have gone through dozens of articles but most of them are referring to CefSharp library in their HTML file which is part of their .Net project. But in my case I don't have any HTML file nor I have any CefSharp library at react side. Does 'bound' gets bind with window object in javascript? Please suggest.</p>