Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
Tooling
3 votes
4 replies
202 views

I am building an e-commerce application with Next.js and I need to manage global state for features like cart, user authentication, and product listings. I have experience with both Redux Toolkit and ...
Best practices
0 votes
3 replies
448 views

I've got a question! I have an app where I use Zustand for my state management. For example I have states for the currentProject, current dataset and current view which decides what it shown. I now ...
Best practices
0 votes
2 replies
270 views

I’m building an e-commerce type website in Next.js where there are multiple sections of stores. Each store card has a heart icon to mark it as a favourite. The same store can appear in: multiple ...
Score of 1
1 answer
104 views

I am doing unit testing for my project. This is the code I want to test: import { create } from "zustand"; import { persist } from "zustand/middleware"; interface LanguageState { ...
Score of 1
1 answer
300 views

I was working on Next.js 15 (App Router) and trying to integrate Server Actions with Zustand for client-side state management. // store.ts import { create } from 'zustand'; export const ...
Score of 2
2 answers
118 views

My HomePage.jsx looks like this: import { Box, Container, SimpleGrid, Text, useColorModeValue, VStack, } from "@chakra-ui/react"; import { useEffect, useState } from "react&...
Score of 0
0 answers
53 views

I’m using React Native with Expo Router and Zustand to handle authentication-based redirection. The logic works correctly on Android, but on Web the useEffect is not triggered, which prevents the user ...
Score of 2
0 answers
60 views

beforeEach(() => { useStore.setState(useStore.getInitialState(), true) }) it("does something", () => { renderComponent() expect(screen.getByLabelText(/Event Type/i))....
Score of 2
1 answer
364 views

I'm building a Next.js 14 app that uses Zustand with the persist middleware to store authentication tokens and user info. My goal is to have the tokens persist across page navigations and browser ...
Score of 0
1 answer
733 views

I have created the following Zustand store. For now it is fairly simple, and I have planned to update its functionality afterwards. import { create } from 'zustand'; import { persist } from 'zustand/...
Score of 1
1 answer
55 views

I'm using Next.js with TypeScript and Zustand for state. I have a music toggle button in my hero section that should play/pause background music. The button UI updates correctly, but the audio doesn't ...
Score of 0
0 answers
250 views

I'm trying to build a reusable createStore utility for Zustand that automatically applies devtools middleware, and optionally wraps with persist and immer. Here's a simplified version of my code: ...
Score of 0
0 answers
135 views

useAppStore is a Zustand Store. I made 3 assumptions based on my understand of React hooks (Please correct me if any of them is wrong): const MessageList: React.FC<MessageListProps> = ({ ...
Score of 1
1 answer
257 views

I am trying to persist state management to session storage. Currently I can save the state on the browser and state is shared on all tabs (new and old) for as long as any one tab is open. However when ...
Score of 1
0 answers
377 views

I'm building a micro-frontend architecture using Webpack Module Federation. I have a host app and a remote app (cart), and I'm trying to share a global Zustand store (themeStore) from the host to the ...

15 30 50 per page
1
2 3 4 5
24