Hi, I'm currently new to NextJS. The issue I'm facing is having the same warning as the above link issue but my problem occurs with the Redux store instead (I'm using the redux tool kit). The warning point out that the problem occurs here
const requestNumber = useAppSelector((state) => state.createRequest.requestNumber) ?? '';
const userInfo: User | undefined = useAppSelector( (state) => state.auth.userInfo );
here is my code
const CreateLayout = ({ children }: { children: React.ReactNode }) => {
const { Content } = Layout;
// const selectedBrandName = useAppSelector((state) => state.createRequest.name);
const router = useRouter();
const dispatch = useAppDispatch();
const spinOn = useAppSelector((state) => state.createRequest.spinOn);
const requestNumber =
useAppSelector((state) => state.createRequest.requestNumber) ?? '';
const userInfo: User | undefined = useAppSelector(
(state) => state.auth.userInfo
);
const response = useGetCreateRequestInfo({
params: {
// requestNumber: requestNumber,
requestNumber: '#130',
tenant: process.env.NEXT_PUBLIC_DOMAIN ?? '',
userId: userInfo?.id ?? '',
},
options: {
refreshInterval: 10000,
},
});
if (response.data?.data) {
dispatch(setCreateRequestData(response.data.data));
}
return (
<Layout className="bg-white">
<section className="flex flex-row gap-[12px] border-b-[#E4E8ED] border-[1px] p-[16px]">
<LeftOutlined
onClick={() => {
dispatch(setDataImageOtherUpload({}));
dispatch(setDataImageUpload({}));
router.back();
}}
/>
<div className="text-[16px] leading-[24px] font-[500] flex flex-col">
<div>Create New Request</div>
<div className="text-[12px] leading-[16px] font-[400] truncate w-[120px]">
{response.data?.data?.insuranceDetail.note}
</div>
</div>
</section>
<Content>{children}</Content>
{spinOn && (
<Spin className="absolute w-full h-screen flex items-center justify-center backdrop-blur-sm bg-white/30" />
)}
</Layout>
);
};
export default CreateLayout;
appreciated any help, thanks for reading