-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0db2f5
commit f373c09
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: persistKey | ||
id: persistKey | ||
--- | ||
|
||
This property allows you to override the default key used to persist the cart in `localStorage`. By default, the cart is stored under the key `root`. | ||
|
||
```js | ||
import ReactDOM from 'react-dom' | ||
import { CartProvider } from 'use-shopping-cart/react' | ||
|
||
import App from './App' | ||
|
||
ReactDOM.render( | ||
<CartProvider | ||
mode="payment" | ||
cartMode="checkout-session" | ||
stripe={process.env.REACT_APP_STRIPE_API_PUBLIC} | ||
billingAddressCollection={false} | ||
successUrl="https://stripe.com" | ||
cancelUrl="https://twitter.com/dayhaysoos" | ||
currency="USD" | ||
shouldPersist={false} | ||
persistKey="my-redux-persist-key" | ||
> | ||
<App /> | ||
</CartProvider>, | ||
document.getElementById('root') | ||
) | ||
``` | ||
|