joinmarket-webui/jam

[v2] avoid recreating browser router on every app render

Open

#1 155 ouverte le 27 févr. 2026

Voir sur GitHub
 (1 commentaire) (0 réactions) (0 assignés)TypeScript (108 forks)auto 404
buggood first issuev2

Métriques du dépôt

Stars
 (325 stars)
Métriques de merge PR
 (Métriques PR en attente)

Description

right now createBrowserRouter() is being called inside the App component body, which means a new router instance gets created on every render.

since App re-renders on state, context, and translation changes, this causes the router to be recreated repeatedly. react router expects the router instance to be stable, and recreating it can reset internal navigation state, interrupt pending fetchers, and potentially cause subtle routing bugs.

the router should be memoized with the correct dependencies or refactored so it is created once and remains stable across renders.

Guide contributeur