Skip to content

Move from react-router to wouter#873

Merged
loichuder merged 2 commits into
mainfrom
migrate-to-wouter
Jun 30, 2026
Merged

Move from react-router to wouter#873
loichuder merged 2 commits into
mainfrom
migrate-to-wouter

Conversation

@loichuder

Copy link
Copy Markdown
Member

For #869

@loichuder loichuder force-pushed the migrate-to-wouter branch from 0e08180 to 4273924 Compare June 29, 2026 12:33
Comment thread src/edition/EditPage.tsx
Comment thread src/navbar/NavBar.tsx Outdated
to={{
pathname: '/edit',
search: state?.workflow
to={`/edit${

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouter does not add aria-current by default so I created a new wrapper component to do it according to https://github.com/molefrog/wouter/blob/v3/packages/wouter/src/use-browser-location.js#how-do-i-make-a-link-active-for-the-current-route

@loichuder loichuder force-pushed the migrate-to-wouter branch 2 times, most recently from 61d7594 to e9d86f0 Compare June 29, 2026 12:54
Comment thread src/navbar/NavLink.tsx Outdated
Comment thread src/edition/hooks.ts
Comment thread src/App.tsx Outdated
Comment thread src/navbar/NavBar.tsx
Comment thread src/navbar/NavBar.tsx Outdated
Comment thread src/navbar/NavLink.tsx Outdated
@loichuder loichuder force-pushed the migrate-to-wouter branch from e9d86f0 to 5400fc3 Compare June 30, 2026 07:29
Comment thread src/navbar/NavLink.tsx Outdated
return (
<Link
className={styles.link}
aria-current={isActive ? 'true' : undefined}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I typically use the syntax isActive || undefined but that's fine

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. Reads much better.

Don't hesitate to point stuff like this, my TS is a bit rusty

@loichuder loichuder force-pushed the migrate-to-wouter branch from 5400fc3 to bf3c82d Compare June 30, 2026 07:35
@loichuder

Copy link
Copy Markdown
Member Author

Thanks for the great review!

@loichuder loichuder force-pushed the migrate-to-wouter branch from bf3c82d to 3bc7ff1 Compare June 30, 2026 07:36
@loichuder loichuder merged commit e1e1df4 into main Jun 30, 2026
2 checks passed
@loichuder loichuder deleted the migrate-to-wouter branch June 30, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants