State management in nextjs13 App Router
Unanswered
hariom mahato posted this in #help-forum
i am getting stuck while using zustand with nextjs13
Can anyone help me to use it in app router properly
import { useProductStore } from "@/store/useProductStore";
import React from "react";
const SellerAllProductClient = () => {
const p=useProductStore.getState().products
console.log(p,"heh")
return <div></div>;
};
export default SellerAllProductClient;
i get data at first but when i save this the data is no there but when i use "use client" in this i get that data but i want data in servercomponent so how i can manage
Can anyone help me to use it in app router properly
import { useProductStore } from "@/store/useProductStore";
import React from "react";
const SellerAllProductClient = () => {
const p=useProductStore.getState().products
console.log(p,"heh")
return <div></div>;
};
export default SellerAllProductClient;
i get data at first but when i save this the data is no there but when i use "use client" in this i get that data but i want data in servercomponent so how i can manage