Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memoize result from useRouteMatch() when a path is passed #7822

Closed
wants to merge 53 commits into from
Closed

Memoize result from useRouteMatch() when a path is passed #7822

wants to merge 53 commits into from

Conversation

jonkoops
Copy link
Contributor

Also adds more test cases, closes #7059

timdorr and others added 30 commits November 7, 2019 10:25
* explain same component in multiple routes

wanted to clarify the behavior seen here: https://codesandbox.io/s/sleepy-hopper-bgntr

* Update packages/react-router/docs/api/Route.md

Co-Authored-By: Tim Dorr <[email protected]>
* Add documentation for component prop

Documented the existence of the `component` prop and gave an example illustrating how to use it

* Update Link.md
* Support `sensitive` matchPath option in NavLink

* Add NavLink sensitive prop tests
* Fixed Link component prop type check

* Update packages/react-router-native/Link.js

Co-authored-by: Tim Dorr <[email protected]>
* Clearly describe API of callback in code

* fix syntax error
Update to latest version, as it doesn't depend anymore on the `gud` package, a package that has a problematic license file (missing copyright).
The API seems to be the same, so there shouldn't be any issues with this update.
the test has passed the rollup packaging mechanism!
emision and others added 13 commits August 4, 2020 10:32
Co-authored-by: Zavrazhnev Konstantin <[email protected]>
Since the project doesn't have much activity right now, issues and PRs are getting closed without further investigation. Until either Ryan or Michael can devote some more time to React Router (understand they are _very_ busy at the moment and fighting to survive the pandemic economy), let's just turn this thing off for now.
"navigates home when you click the logo" fails because of minor issues

* the path to the route with the link was wrong
* the id for the link was wrong
* the text on the target page was wrong
* providing an argument to the anonymous function makes the timeout waiting for completion callback
@jonkoops
Copy link
Contributor Author

@timdorr I've incorporated the feedback, can you take another look?

}

const path = "/home";
const renderer = create(
Copy link
Contributor Author

@jonkoops jonkoops Apr 20, 2021

Choose a reason for hiding this comment

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

Perhaps I should be wrapping this in a renderStrict call as well. Can't really use it directly since renderStrict calls ReactDOM, but I could export the StrictMode wrapper used there.

@jonkoops
Copy link
Contributor Author

@timdorr any chance you can take a look into this to see if it can be merged?

@jonkoops jonkoops requested a review from timdorr July 20, 2021 20:33
@timdorr timdorr requested review from mjackson and removed request for timdorr July 21, 2021 14:40
@timdorr
Copy link
Member

timdorr commented Jul 21, 2021

@mjackson is better suited for this than me right now.

@jonkoops
Copy link
Contributor Author

jonkoops commented Jul 27, 2021

@mjackson Would you prefer that I direct this change into v6? I can see the same behavior is still present there for useMatch() as is in the current stable.

Also will v6 still have the useRouteMatch() function, or is it being dropped?

@jonkoops
Copy link
Contributor Author

Closing this PR as the conflicts with the new version are just too great.

@jonkoops jonkoops closed this Oct 27, 2021
@jonkoops jonkoops deleted the feature/memo-route-match branch October 27, 2021 11:58
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.

useRouterMatch returns new object on each render