import { useRef, useEffect } from "react";
export const useDidMountEffect = (func: any, deps: any) => {
const didMount = useRef(false);
useEffect(() => {
if (didMount.current) func();
else didMount.current = true;
}, deps);
};
import { useDidMountEffect } from "../../hooks/useDidMountEffect";
const queryString = () => {
location.search = `categoryCode=${categoryCode}`;
navigate(`?${location.search}`);
};
useDidMountEffect(queryString, [categoryCode]