Video: Custom Snipcart Hook
Ecommerce on the Jamstack with Snipcart, Next.js, & WordPress
Released: 2021-07-31
-
1. Introduction
1m30s
-
2. NextJS
8m14s
-
3. Netlify & Github
15m46s
-
4. Sass, Components, Store Header
21m33s
-
5. Products, CSS Grid, Button component
22m39s
-
6. Snipcart, Env Variables
17m16s
-
7. WordPress, WPGraphQL
18m53s
-
8. GraphQL, Apollo Client
14m4s
-
9. Autodeploy with Web Hooks
5m50s
-
10. Dynamic Routes
19m27s
-
11. Custom Snipcart Hook
16m39s
-
12. Shared Layout
8m22s
-
13. Branding & Personality
23m26s
-
14. Snipcart Theming & Customization
24m13s
-
15. Custom Taxonomy
23m17s
-
16. Search
16m50s
Custom Snipcart Hook
We were able to successfully get Snipcart up and running on our original app, but as we might have noticed, we lose some of the functionality as we navigate between our new dynamic pages due to the clientside route changes. To solve this, we're going to learn how to create a custom React hook that we can use globally with the Context API that allows us to tap into Snipcart's state directly in order to make sure we're always displaying accurate and up-to-date order details.