v3.0.0-beta.3
Pre-release
Pre-release
dayhaysoos
released this
09 Mar 16:38
·
134 commits
to redux
since this release
React API has changed with this version
With the switch from just being a hooks library to a redux implementation, there have been some major changes to how you use the React version of this library.
- the
stripe
value in theCartProvider />
needs to be your Public Stripe API key.
Redux doesn't like non-serializable types being passed into it, to mitigate this we had to set up a middleware that handles initializing the Stripe object for you. addItem()
API has changed to using 2 params instead of 4.
addItem(productObject, optionsObject = {count: 1, product_metadata: {...}, price_metadata: {...})
The second param is optional, but under the hood, it creates a default for the options object where count
is 1