aws / aws/graph-explorer

Replace render-phase `navigate()` calls with declarative `<Navigate>`

Open
#1,847 0 comments 0 reactions 0 assignees View on GitHub
internal needs-triage tech debt
Dominant language
TypeScript
Stars
481
Forks
108
Avg merge
6d 8h
Merged PRs (30d)
5

Description

`DataExplorer.tsx` (~L75–79) calls `navigate(...)` during render when no `vertexType` is present. Navigating during render is a React anti-pattern that warns and can misbehave under StrictMode and concurrent rendering. Replace with ``.

`components/Redirect.tsx` is a hand-rolled reimplementation of React Router's built-in `` (a `useEffect` + `useNavigate`). Delete it and use `` directly at its one call site (`App.tsx:28`).

**Affected files:** `routes/DataExplorer/DataExplorer.tsx`, `components/Redirect.tsx` (delete), `App.tsx`.

**Outcome:** No render-phase navigation; `Redirect` component removed in favor of built-in ``.

> [!IMPORTANT]
> Internal only — this issue is maintained by the core team and is not accepting external contributions.

Contributor guide

Open the contributing guide

Research direction

Start with routes/DataExplorer/DataExplorer.tsx around lines 75–79 and App.tsx around line 28, then inspect components/Redirect.tsx. Replace render-phase navigation and the hand-rolled redirect with React Router’s declarative Navigate, remove Redirect, and confirm no render-phase navigation or Redirect usage remains.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.