79734652

Date: 2025-08-13 18:59:42
Score: 2
Natty:
Report link

If someone have similar error, I found answer. First of all I add

skipHydration: true,

to the store. After thar I made Hydrations component. It looks like this:

'use client';

import { useAuthStore } from '@/store/auth.store';
import { useEffect } from 'react';


export default function Hydrations() {
    useEffect(() => {
        useAuthStore.persist.rehydrate();
    }, []);

    return null;
}

And I import it in layout.tsx

Also, ChatGPT give me that hook, maybe someone neet it. It check if hydration was by now (??). Idk, you can use it if you want.

'use client';

import { useState, useEffect } from 'react';

export function useIsMounted() {
  const [isMounted, setIsMounted] = useState(false);

  useEffect(() => {
    setIsMounted(true);
  }, []);

  return isMounted;
}
Reasons:
  • Whitelisted phrase (-1.5): you can use
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): have similar error
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Anastasia Moroz