Skip to content

Commit 3efb3bf

Browse files
committed
small refactor
1 parent 296a78e commit 3efb3bf

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

packages/waku/src/router/client.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -816,12 +816,7 @@ const InnerRouter = ({
816816
const routeRef = useRef(route);
817817
useEffect(() => {
818818
routeRef.current = initialRoute;
819-
setRoute((prev) => {
820-
if (isSameRoute(prev, initialRoute)) {
821-
return prev;
822-
}
823-
return initialRoute;
824-
});
819+
setRoute((prev) => (isSameRoute(prev, initialRoute) ? prev : initialRoute));
825820
}, [initialRoute]);
826821
const [err, setErr] = useState<unknown>(null);
827822

0 commit comments

Comments
 (0)