How to persist your Zustand store in Next.js 13 (and 14) with app router

Опубликовано: 29 Октябрь 2023
на канале: QuickXplain
4,399
57

Here is how to store your Zustand state in browser's local storage.

Github repo from the video:
https://github.com/bzhn/qxp-nextjs-zu...

Official Zustand article about persisting your store:
https://docs.pmnd.rs/zustand/integrat...

00:00 - Introduction
00:16 - What result you will get from this video
01:06 - Creating Next.js 14 (with app/ router) project with Typescript. Setting everything up
01:25 - Web application code structure
02:21 - Get products data from fakestore API (fakestoreapi.com)
02:39 - Creating simple online-shop
03:40 - Implementing zustand state without persistance (for now)
06:14 - How to persist zustand storage in Next.js with app router
07:24 (07:54) - How to fix hydration error after persisting zustand store
09:11 - Some new methods for incrementing, decrementing and removing product from localStorage product cart
09:50 - Outro


Смотрите видео How to persist your Zustand store in Next.js 13 (and 14) with app router онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь QuickXplain 29 Октябрь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 4,399 раз и оно понравилось 57 людям.