one
Version:
One is a new React Framework that makes Vite serve both native and web.
17 lines (16 loc) • 522 B
JavaScript
import { useEffect } from "react";
import { usePathname } from "./hooks";
import { registerScrollGroup } from "./views/ScrollBehavior";
function useScrollGroup(groupPath) {
const pathname = usePathname();
useEffect(() => {
const group = groupPath || pathname;
if (!group) return;
const normalizedGroup = group.endsWith("/") ? group.slice(0, -1) : group;
return registerScrollGroup(normalizedGroup);
}, [groupPath, pathname]);
}
export {
useScrollGroup
};
//# sourceMappingURL=useScrollGroup.js.map