Useful components and utilities for working with React Router
by sindresorhusTypeScript
Last 12 weeks · 0 commits
4 of 6 standards met
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.
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.
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.