title: How to use PayPal's Express In-Context Checkout with ReactJS?
body: <p>I'm following this <a href="https://developer.paypal.com/docs/integration/direct/express-checkout/enable-in-context-checkout/" rel="nofollow noreferrer">PayPal tutorial</a> about how to generate a PayPal button, but nothing works. The code it provides to make the button appear mysteriously worked only once for me, but after a refresh, it disappear and there's no Christ to make it appear again.</p>
  
  <p>This is the code being executed inside of a React component</p>
  
  <pre><code>  class Storefronts extends Component {
      render() {
        return (
          &lt;div className="layout-wrapper"&gt;
            {this.props.location.pathname === '/shops' ? &lt;Shops {...this.props}/&gt; : &lt;Basic {...this.props}/&gt;}
            &lt;script&gt;
              window.paypalCheckoutReady = function() {
                paypal.checkout.setup('MERCHANTID', {
                  environment: 'sandbox',
                  container: 'test1',
                })
              }
            &lt;/script&gt;
          &lt;/div&gt;
        );
      }
    }
  </code></pre>
  
  <p>This is a <code>Storefront</code> component that holds a <code>Shop</code>, and inside this one has a <code>Card</code> component. Basically, it's a shop that shows its products, and each product (<code>Card</code>) needs to have a button:</p>
  
  <pre><code>class Card extends Editor {
    render() {
      const {list} = this.props;
      let img = '/images/logo-v2-small.jpg';
  
      return (
        &lt;Row&gt;
        {list.map(item =&gt;{
          return (
            &lt;Col xs={6} md={3}&gt;
              &lt;Link to={{ pathname: '/shops/' + item.id }}&gt;
                &lt;Thumbnail src={img} alt={item.name}&gt;
                  &lt;h3&gt;{item.name}&lt;/h3&gt;
                  &lt;p&gt;{this.parseHtmlToReact(item.description)}&lt;/p&gt;
                  &lt;p&gt;{item.address}&lt;/p&gt;
                  &lt;p&gt;
                    &lt;Button bsStyle="primary"&gt;Book&lt;/Button&gt;
                    &lt;a id="test1" href="/checkout"/&gt; // The button should appear here.
                    &lt;p className="pull-right"&gt;
                      {item.rating} 
                    &lt;/p&gt;
                  &lt;/p&gt;
                &lt;/Thumbnail&gt;
              &lt;/Link&gt;
            &lt;/Col&gt;
          )
        })}
        &lt;/Row&gt;
      );
    }
  }
  </code></pre>
  
  <p>There's nothing saying about its usage with React and no recent module for it.</p>