{"id":15891168,"url":"https://github.com/ctrlplusb/react-router-match-issue","last_synced_at":"2025-04-02T17:23:54.326Z","repository":{"id":66058719,"uuid":"76275099","full_name":"ctrlplusb/react-router-match-issue","owner":"ctrlplusb","description":"Strange issue when using react-router-addons-routes to do matching.","archived":false,"fork":false,"pushed_at":"2016-12-12T16:48:32.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T08:11:49.480Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ctrlplusb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-12T16:35:01.000Z","updated_at":"2016-12-12T16:35:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d926158-31b6-465d-b4a6-eee3a29f743c","html_url":"https://github.com/ctrlplusb/react-router-match-issue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrlplusb%2Freact-router-match-issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrlplusb%2Freact-router-match-issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrlplusb%2Freact-router-match-issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrlplusb%2Freact-router-match-issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctrlplusb","download_url":"https://codeload.github.com/ctrlplusb/react-router-match-issue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246857725,"owners_count":20845180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T07:20:50.785Z","updated_at":"2025-04-02T17:23:54.302Z","avatar_url":"https://github.com/ctrlplusb.png","language":"JavaScript","readme":"## react-router-addons-routes bug report\n\nhttps://github.com/ReactTraining/react-router-addons-routes/issues/15\n\n```bash\nyarn\nnpm run start\n```\n\n---\n\nAn example application is contained withing `src/index.js` which demonstrates a minimum routing configuration to recreate this issue.\n\nClicking on \"Foo\" or \"Bar\" should both result in resolved/rendered `Match` instances, however, as we are using `react-router-addons-routes/matchRoutesToLocation` to match against a custom set of routes before any of our `Match` components get hit something strange occurs and our \"/foo/bar\" `Match` component never gets rendered.\n\nLook at the `CustomRouteMatcher` component in the src folder which is responsible for executing the custom route matching.  If you clear the `customRoutes` array and then try browse to \"/foo/bar\" - you will notice all the expected `Match` components now get rendered.\n\nInterestingly, if you append a \"/\" to the end of \"/foo\" in the `customRoutes` array you will notice that matching now works correctly and the `Bar` component is rendered.\n\nI suspect there may be an issue with the way the internals of `react-router` caches routes/matches perhaps?\n\nOr maybe there is behaviour baked into the route patterns that I am unaware of.\n\n---\n\n[LIVE EXAMPLE](https://react-router-match-debugging-wygetnppwf.now.sh)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctrlplusb%2Freact-router-match-issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctrlplusb%2Freact-router-match-issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctrlplusb%2Freact-router-match-issue/lists"}