@devries-cameron20 / t3code Mirror · read-only / commits / 366106ac51
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 06:45 UTC

perf(web): the escape-to-go-back hook compiles without manual memoization (#20564)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 16, 2026 at 22:06 UTC 366106ac510a0b254a6ac746d3ae2db34975b19c
1 file changed +3 -3
apps/web/src/hooks/useNavigateBack.ts
+3 -3
@@ -1,17 +1,17 @@
1 import { useCanGoBack, useNavigate } from "@tanstack/react-router";
2 -import { useCallback, useEffect } from "react";
2 +import { useEffect } from "react";
3
4 function useNavigateBack() {
5 const navigate = useNavigate();
6 const canGoBack = useCanGoBack();
7
8 - return useCallback(() => {
8 + return () => {
9 if (canGoBack) {
10 window.history.back();
11 return;
12 }
13 void navigate({ to: "/" });
14 - }, [canGoBack, navigate]);
14 + };
15 }
16
17 export function useEscapeToGoBack(onEscape?: () => void) {