title: React on Rails - How to change Login Link to Logout Link?
body: <p>I am trying to create  rails app with react. I have used devise gem for user management. I am able to login, but after i login i want to change login link to logout link.
  Following is what i have tried:</p>
  
  <p>This is the html.erb file of root page:</p>
  
  <pre><code>&lt;%= react_component('HomeApp', props: {data: @contact_form_props}) %&gt;
  </code></pre>
  
  <p>This is the file that contains the links of header:</p>
  
  <pre><code>const HeaderApp = (props, _railsContext) =&gt; {
      const reactComponent = (
          &lt;nav id="mainNav" className="navbar navbar-default navbar-custom navbar-fixed-top faq-container"&gt;
              &lt;div className="container"&gt;
                  &lt;div className="collapse navbar-collapse" id="bs-example-navbar-collapse-1"&gt;
                      &lt;div&gt;
                          &lt;ul className="nav navbar-nav navbar-right"&gt;
                              &lt;li&gt;
                                &lt;Link href={this.props.path} to=""&gt;Login&lt;/Link&gt;
                              &lt;/li&gt;
                          &lt;/ul&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/nav&gt;
      );
      return reactComponent;
  };
  </code></pre>
  
  <p>After i login in wish to convert login link to logout. Can any one help me out. Thank you in advance.</p>