title: Redirect React Component when submit form express
body: <p>I'm trying to redirect to a React Component when submit the form with express. This is my code:</p>
  
  <p><strong>Express.js</strong></p>
  
  <pre><code>app.use(bodyParser.urlencoded({extended: true}))
  
  app.use(express.static(publicPath));
  
  app.get('*', (req, res) =&gt; {
      res.sendFile(path.join(publicPath, 'index.html'))
  })
  
  app.post('/charge', (req, res) =&gt; {
  
      const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY)
  
      stripe.charges.create({
          amount: req.body.totalAmount * 100,
          currency: 'eur',
          source: req.body.stripeToken,
          description: "Example charge",
          receipt_email: req.body.receiptEmail
      }).then((charge) =&gt; {
          console.log(req.body)
      }).catch((err) =&gt; {
          console.log(err)
      })
  </code></pre>
  
  <p><strong>CheckoutForm.js</strong></p>
  
  <pre><code>    handleSubmit = (e) =&gt; {
              e.preventDefault()
  
              this.props.stripe.createToken({ name: this.state.name }).then(({ token }) =&gt; {
                  console.log(token)
                  this.stripeTokenHandler(token)
              }) 
  
  
          }
  
          stripeTokenHandler = (token) =&gt; {
              const form = document.getElementById('form')
  
              const hiddenInput = document.createElement('input')
              hiddenInput.setAttribute('type', 'hidden')
              hiddenInput.setAttribute('name', 'stripeToken')
              hiddenInput.setAttribute('value', token.id)
  
              form.appendChild(hiddenInput)
              form.submit()       
          }
  
  render() {
          return (
              &lt;div className="payment-container"&gt;    
                  &lt;form id="form" className="checkout-form" onSubmit={this.onSubmit}&gt;
  
                      &lt;label&gt;
                          Card Number
                          &lt;CardNumberElement
                              onChange={this.onChange}
                              style={{ base: { color: 'white' } }}
                          /&gt;
                      &lt;/label&gt;
                      &lt;label&gt;
                          Titular Name
                          &lt;input
                              type="text"
                              value={this.state.name}
                              onChange={this.handleText}
                              className="input-text"
                              placeholder="Full Name"
                          /&gt;
                      &lt;/label&gt;
                      &lt;label&gt;
                          Expiration Date
                          &lt;CardExpiryElement style={{base: {color: 'white'}}} /&gt;
                      &lt;/label&gt;
                      &lt;label&gt;
                          CVC
                          &lt;CardCVCElement style={{base: {color: 'white'}}} /&gt;
                      &lt;/label&gt;
                      &lt;label&gt;
                          Email
                          &lt;input
                              type="text"
                              value={this.state.email}
                              onChange={this.handleEmail}
                              className="input-text"
                              name="receiptEmail"
                              placeholder="Email"
                          /&gt;
                      &lt;/label&gt;
                      &lt;button className="btn-buy"&gt;Pay now&lt;/button&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          )}
  }
  </code></pre>
  
  <p>The form submitted correctly and register the payment. When I submitted now gets the request body. What's the way to redirect a component with the request form?</p>