title: using tawk Tawk_API.setAttributes with reactjs
body: <p>I have the following App Component :-</p>
  <pre><code>import React, { useEffect } from &quot;react&quot;;
  import Home from &quot;./pages/Home&quot;;
  import About from &quot;./pages/About&quot;;
  
  function App() {
    useEffect(() =&gt; {
      var Tawk_API = Tawk_API || {},
        Tawk_LoadStart = new Date();
      (function () {
        var s1 = document.createElement(&quot;script&quot;),
          s0 = document.getElementsByTagName(&quot;script&quot;)[0];
        s1.async = true;
        s1.src = &quot;https://embed.tawk.to/5ab8d/default&quot;;
        s1.charset = &quot;UTF-8&quot;;
        s1.setAttribute(&quot;crossorigin&quot;, &quot;*&quot;);
        s0.parentNode.insertBefore(s1, s0);
      })();
      Tawk_API.onLoad = function () {
        console.log(&quot;chat loaded&quot;);
        Tawk_API.setAttributes(
          {
            name: &quot;Test Name&quot;,
            email: &quot;email@email.com&quot;,
            hash: &quot;hash value&quot;,
          },
          function (error) {}
        );
      };
    }, []);
  
    return (
      &lt;div&gt;
        &lt;div className=&quot;container-fluid rtl&quot;&gt;
          &lt;Route exact path=&quot;/&quot; component={Home} /&gt;
          &lt;Route path=&quot;/about&quot; component={About} /&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    );
  }
  
  export default App;
  </code></pre>
  <p>I can see that chat widget, but when i am starting a chat , don't get the visitor assigned name.</p>
  <p>How can i use the setAttributes in reactjs?</p>