This is a simple starter project built with Next.js 14.2 and Zustand. It provides a foundational setup to help you quickly get started with state management in Next.js applications.
- State Management: Uses Zustand for lightweight and scalable state management.
- Local Storage Persistence: Includes the capability to persist state to
localStorage
. - Multiple Branches:
main
: Basic Zustand implementation.persist
: Zustand with localStorage persistence.
-
Clone the repository:
git clone https://github.com/MiladJoodi/Zustand_Starter_Project.git
-
Navigate to the project directory:
cd Zustand_Starter_Project
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
Open http://localhost:3000 in your browser to see the app.
The main branch contains a basic implementation of Zustand to manage state efficiently in a Next.js environment.
The persist
branch adds functionality to persist state in localStorage
, ensuring that your state remains intact even after a page refresh.
To switch to the persist
branch, run the following command:
git checkout persist
Feel free to open issues or submit pull requests for any improvements or suggestions. Contributions are always welcome!
Check out the project on GitHub: Zustand Starter Project
Happy coding! ๐