Skip to content
This repository has been archived by the owner on Mar 27, 2021. It is now read-only.

Commit

Permalink
Add note on injectStripe HOC usage (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
indiesquidge authored and michelle committed Jul 26, 2017
1 parent 4a4a627 commit a59491b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,15 @@ export default MyStoreCheckout;

### Setting up your payment form (`injectStripe`)

Use the `injectStripe` Higher-Order Component (HOC) to build your payment form components in the `Elements` tree. This HOC injects the `stripe`
instance that manages your `Elements` groups. You can call `createToken` on the injected `stripe` instance to submit
payment data to Stripe.
Use the `injectStripe` Higher-Order Component (HOC) to build your payment form
components in the `Elements` tree. This HOC injects the `stripe` instance that
manages your `Elements` groups. You can call `createToken` on the injected
`stripe` instance to submit payment data to Stripe.

> ⚠️ NOTE: `injectStripe` cannot be used on the same element that renders the
> `Elements` component; it must be used on the child component of `Elements`.
> This is strictly because the component using `injectStripe` is injected with
> the `stripe` prop at build time, before its `render` method is invoked.
```js
// CheckoutForm.js
Expand Down

0 comments on commit a59491b

Please sign in to comment.