{"id":20617650,"url":"https://github.com/alexseitsinger/react-nested-routes","last_synced_at":"2026-05-10T05:34:06.748Z","repository":{"id":34735209,"uuid":"181783017","full_name":"alexseitsinger/react-nested-routes","owner":"alexseitsinger","description":"Allows routes that are nested and routes for modals.","archived":false,"fork":false,"pushed_at":"2023-01-03T19:50:47.000Z","size":2000,"stargazers_count":0,"open_issues_count":18,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-18T18:51:03.888Z","etag":null,"topics":["modal","react","react-router","route"],"latest_commit_sha":null,"homepage":"https://www.alexseitsinger.com/packages/node/react-nested-routes","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexseitsinger.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-16T23:37:31.000Z","updated_at":"2019-06-29T16:00:31.000Z","dependencies_parsed_at":"2023-01-15T08:50:45.661Z","dependency_job_id":null,"html_url":"https://github.com/alexseitsinger/react-nested-routes","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/alexseitsinger/react-nested-routes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexseitsinger%2Freact-nested-routes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexseitsinger%2Freact-nested-routes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexseitsinger%2Freact-nested-routes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexseitsinger%2Freact-nested-routes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexseitsinger","download_url":"https://codeload.github.com/alexseitsinger/react-nested-routes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexseitsinger%2Freact-nested-routes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260616579,"owners_count":23036868,"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":["modal","react","react-router","route"],"created_at":"2024-11-16T12:05:12.336Z","updated_at":"2026-05-10T05:34:06.714Z","avatar_url":"https://github.com/alexseitsinger.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n### Table of Contents\n\n-   [createRouteComponent][1]\n    -   [Parameters][2]\n    -   [Examples][3]\n\n## createRouteComponent\n\nCreates a stateless functional component for use in the root route. Routes that are marked with `modal: true` are rendered WITH their parent route component.\n\n### Parameters\n\n-   `config` **[Object][4]** An object of route configurations.\n    -   `config.Switch`  \n    -   `config.Route`  \n    -   `config.config`  \n\n### Examples\n\n```javascript\nimport React from \"react\"\nimport { Router, Route, Switch } from \"react-router\"\nimport { createRouteComponent }  from \"@alexseitsinger/react-nested-routes\"\n\nimport LandingPage from \"./pages/landing\"\nimport AboutPage from \"./pages/about\"\nimport AboutModalPage from \"./pages/about-modal\"\nimport NotFoundPage from \"./pages/not-found\"\n\nconst config = {\n  path: \"/\",\n  Component: LandingPage,\n  routes: [\n    {path: \"*\", Component: NotFoundPage},\n    {path: \"about\", Component: AboutPage, routes: [\n      {path: \"modal\", Component: AboutModalPage, modal: true},\n    ]}\n  ]\n}\n\nfunction App(props) {\n  const RouteComponent = createRouteComponent({ Switch, Route, config })\n  return (\n    \u003cRouter\u003e\n      \u003cLayout\u003e\n        \u003cRoute component={RouteComponent} /\u003e\n      \u003c/Layout\u003e\n    \u003c/Router\u003e\n  )\n}\n\nexport default App\n```\n\nReturns **[Function][5]** A stateless functional component to be used in the root route.\n\n[1]: #createroutecomponent\n\n[2]: #parameters\n\n[3]: #examples\n\n[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\n\n[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexseitsinger%2Freact-nested-routes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexseitsinger%2Freact-nested-routes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexseitsinger%2Freact-nested-routes/lists"}