Server: Phase 2 (REVIEW not respected yet)
This commit is contained in:
1 parent
5d16ded553
commit
142b47674d
4271 files changed
+1203269
No files matched your search
+13
@@ -0,0 +1,13 @@
|
||||
import { useRouter } from "./useRouter.js";
|
||||
import { isServer } from "@tanstack/router-core/isServer";
|
||||
import { useSelector } from "@tanstack/react-store";
|
||||
//#region src/useCanGoBack.ts
|
||||
function useCanGoBack() {
|
||||
const router = useRouter();
|
||||
if (isServer ?? router.isServer) return router.stores.location.get().state.__TSR_index !== 0;
|
||||
return useSelector(router.stores.location, (location) => location.state.__TSR_index !== 0);
|
||||
}
|
||||
//#endregion
|
||||
export { useCanGoBack };
|
||||
|
||||
//# sourceMappingURL=useCanGoBack.js.map
|
||||
Reference in new issue
Block a user