react-ts-cart
v0.2.21
Published
* start dev server ```yarn dev``` * configure your shopify shop by setting ```SHOPIFY_STOREFRONT_ENDPOINT``` and ```SHOPIFY_STOREFRONT_TOKEN``` in ```index.html```
Readme
Local Development
- start dev server
yarn dev - configure your shopify shop by setting
SHOPIFY_STOREFRONT_ENDPOINTandSHOPIFY_STOREFRONT_TOKENinindex.html
Build and Publish
- set your version in
package.json, manually or by some script yarn build- optional: you might also run
yarn build:debugto build a unminified version of the javascript for easier debugging purposes npm publish
Key Concepts
Embed the <CartWidget /> component in your React App and use <BuyButton /> components to fill the cart. Alternatively you can use the exported hooks like useCreateCart and useCreateProductLine if you want to manually fill the cart. For a working example see ./src/App.tsx. If there is no SHOPIFY_STOREFRONT_ENDPOINT and SHOPIFY_STOREFRONT_TOKEN on the window (e.g. in server environment), you can pass them manually when creating hooks.
