GitShow/sindresorhus/react-router-util
sindresorhus

react-router-util

Useful components and utilities for working with React Router

by sindresorhus
npm-packagereactreact-componentreact-routerrouterutilities
Star on GitHubForknpm

TypeScript

323 stars13 forks7 contributorsQuiet · 11mo agoSince 2018v1.0.0MIT

Meet the team

See all 7 on GitHub →
sindresorhus
sindresorhus30 contributions
agouil
agouil2 contributions
antoniofpereir
antoniofpereir1 contribution
Richienb
Richienb1 contribution
ronnyhaase
ronnyhaase1 contribution
rafaelfbs
rafaelfbs1 contribution

Languages

View on GitHub →
TypeScript100%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
71
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
suchipi
Backwards navigation helpersClosedIssue

Per https://twitter.com/sindresorhus/status/953743983678717955 We have these two helpers in our app which have been useful: Looks back in history to find which entry matches pathname, and then moves back to that entry. We implemented using MemoryRouter; depending on the limitations of BrowserRouter, it might but always be possible (I don't think BrowserRouter has an entries array on router.history). This is useful when you have routes in history that the user should not go back to, for example when going through a wizard or filling out a multi-step form. Goes back history.length - 1 and then replaces the current route with the new location (where location is anything that can be passed to history.push). This can be useful when, for example, the user logs out of the app. IssueHunt Summary sindresorhus has been rewarded. Backers (Total: $30.00) issuehunt ($30.00) Submitted pull Requests #25 Add function and component Tips Checkout the Issuehunt explorer to discover more funded issues. Need some help from other developers? Add your repositories on IssueHunt to raise funds.

suchipi · 11mo ago
bthallion
Testing with MemoryRouterClosedIssue

I'm trying to write Ava unit tests for a component using AuthenticatedRoute, but I don't think there is a way to get this to work with the MemoryRouter right now. Do you have any suggestions for workarounds?

bthallion · 11mo ago
sindresorhus
Add more tests and prop-typesClosedIssue

I didn't feel it was worth all the boilerplate and setup just for 4 super simple exports that I've manually tested well, but tests should be added when more things are added. Should use AVA. This task also includes adding prop types and default prop values to the types.** Inspiration: https://github.com/ReactTraining/react-router/tree/master/packages/react-router-dom/modules/__tests__ IssueHunt Summary mmulet has been rewarded. Backers (Total: $40.00) issuehunt ($40.00) Submitted pull Requests #341 fix frame flash on bounce #332 Tips Checkout the Issuehunt explorer to discover more funded issues. Need some help from other developers? Add your repositories on IssueHunt to raise funds.

sindresorhus · 1y ago
Structured data for AI agents

Repository: sindresorhus/react-router-util. Description: Useful components and utilities for working with React Router Stars: 323, Forks: 13. Primary language: TypeScript. Languages: TypeScript (100%). License: MIT. Topics: npm-package, react, react-component, react-router, router, utilities. Latest release: v1.0.0 (11mo ago). Open PRs: 0, open issues: 0. Last activity: 11mo ago. Community health: 71%. Top contributors: sindresorhus, agouil, antoniofpereir, Richienb, ronnyhaase, rafaelfbs.

·@ofershap

Replace github.com with gitshow.dev