Use Facebook Login Button with React
<p>I'm trying Facebook authentication for my app for the first time.  I'm able to get it working fine through a tutorial, I can login a user and log them out using the handy Facebook Login Button as shown in an example in the Facebook SDK docs here:</p>

<p><a href="https://developers.facebook.com/docs/facebook-login/web" rel="noreferrer">https://developers.facebook.com/docs/facebook-login/web</a></p>

<p>I love using this button because it is easy, subscribes to Facebook branding requirements automatically, and because it automatically becomes a Facebook logout button when a user is logged in.  Perfect in every way.  Here's how the button's code looks with auto-logout included:</p>

<pre><code>&lt;fb:login-button data-auto-logout-link="true" scope="public_profile" onlogin="checkLoginState();"&gt;
&lt;/fb:login-button&gt;
</code></pre>

<p>Seems like gravy, until I try it in a ReactJS page.</p>

<pre><code>// From the tutorials
&lt;script type='text/babel'&gt;
  var CommentBox = React.createClass({
    render: function() {
      return (
        &lt;div className="commentBox"&gt;
          Hello, world! I am a CommentBox.&lt;br /&gt;
          // MY ADDITION ... it breaks
          &lt;fb:login-button data-auto-logout-link="true" scope="public_profile,email" onlogin="checkLoginState();"&gt;
          &lt;/fb:login-button&gt;
        &lt;/div&gt;
      );
    }
  });
  ReactDOM.render(
    &lt;CommentBox /&gt;,
    document.getElementById('content')
  );
&lt;/script&gt;
</code></pre>

<p>I also tried it like this:</p>

<pre><code>ReactDOM.render(
    &lt;fb:login-button data-auto-logout-link="true" scope="public_profile,email" onlogin="checkLoginState();"&gt;&lt;/fb:login-button&gt;,
    document.getElementById('loginbutton')
);
</code></pre>

<p>I can't include the FB SDK Login Button this way because it says "JSX is not XML".  Fair enough I guess.</p>

<p>Is there any way to include this handy button in a React page, or do I just have to create a custom FB button?  I'd have thought this seemed like such a common use case, and since Facebook gave us React, I'm surprised I couldn't find a way to use this solution more easily.  (Making the custom button isn't the end of the world, but I want to know if there's a better/easier way.)</p>