title: Stripe redirectToCheckout - "TypeError: stripe.redirectToCheckout is not a function"
body: <p>I have a backend in express that takes a productID and returns a Stripe sessionID which I thought could be used with <code>Stripe.redirectToCheckout</code>.
  Output from backend:</p>
  
  <pre><code>    "status": "success",
      "session": {
          "id": "cs_test_8l6LSFDpAXXXXXXX",
          "object": "checkout.session",
          "billing_address_collection": null,
          "cancel_url": "http://127.0.0.1:3000/product/undefined",
          "client_reference_id": "5dfd96267d707d32dwe1834967532",
          "customer": null,
          "customer_email": "jlkfsad@gmail.com",
          "display_items": [
              {
                  "amount": 3999,
                  "currency": "usd",
                  "custom": {
                      "description": "Learn any long term commitment",
                      "images": null,
                      "name": "lifetime Product"
                  },
                  "quantity": 1,
                  "type": "custom"
              }
          ],
          "livemode": false,
          "locale": null,
          "mode": "payment",
          "payment_intent": "pi_1FvUXBLs8D14wk3oUL3dwxmMOO8",
          "payment_method_types": [
              "card"
          ],
          "setup_intent": null,
          "submit_type": null,
          "subscription": null,
          "success_url": "http://127.0.0.1:3000/my-products/?product=5dfd96267d70723e1834967532&amp;user=5e011031ac24131ed53d7439fb68&amp;price=39.99"
      }
  }
  </code></pre>
  
  <p>I am not sure how I can use <code>Stripe.redirectToCheckout</code> in my react frontend after the sessionID has been generated. Below is what i tried but getting  "TypeError: stripe.redirectToCheckout is not a function" error.</p>
  
  <pre><code>import { Link } from "react-router-dom";
  import { connect } from "react-redux";
  
  import { Elements, StripeProvider, Stripe } from "react-stripe-elements";
  
  import MyStoreCheckout from "../../components/MyStoreCheckout/MyStoreCheckout";
  import Spinner from "../../components/UI/Spinner/Spinner";
  import * as actions from "../../store/actions/index";
  
  import classes from "./Subscription.module.css";
  
  const stripe = require("stripe-client")(
    "sk_test_XXXXXX"
  );
  
  class Subscription extends Component {
    constructor(props) {
      super(props);
    }
  
    monthlySubscribeClickHandler = () =&gt; {
      const productId = "5dfd95e27dw4231707e1834967531";
      this.props.onSubscribeClicked(this.props.token, productId);
      stripe.redirectToCheckout({
        sessionId: this.props.sessionId
      });
  
    };
  
    render() {
      let buttonName = "SUBSCRIBE";
      return (
        &lt;div className={classes.User}&gt;
          &lt;h1&gt;Monthly Subscription&lt;/h1&gt;
          &lt;h3&gt;Learn all modules for $9.99 per month&lt;/h3&gt;
          &lt;Link to=""&gt;
            &lt;button onClick={this.monthlySubscribeClickHandler}&gt;
              {buttonName}
            &lt;/button&gt;
          &lt;/Link&gt;
          &lt;h1&gt;Lifetime Access&lt;/h1&gt;
          &lt;h3&gt;Learn all modules for a nominal payment of $34.99&lt;/h3&gt;
          &lt;Link to=""&gt;
            &lt;button onClick={this.lifetimeSubscribeClickHandler}&gt;
              Make one-time payment
            &lt;/button&gt;
          &lt;/Link&gt;
        &lt;/div&gt;
      );
    }
  }
  const mapStateToProps = state =&gt; {
    return {
      loading: state.auth.loading,
      error: state.auth.error,
      message: state.auth.message,
      status: state.auth.status,
      userId: state.auth.status,
      token: state.auth.token,
      sessionId: state.subscription.sessionId
    };
  };
  
  const mapDispatchToProps = dispatch =&gt; {
    return {
      onSubscribeClicked: (token, productId) =&gt;
        dispatch(actions.subscribeProduct(token, productId))
    };
  };
  
  export default connect(
    mapStateToProps,
    mapDispatchToProps
  )(Subscription);
  </code></pre>
  
  <p>Please help!</p>