{"id":19704550,"url":"https://github.com/spencertorres/react-route-props","last_synced_at":"2026-04-05T22:33:29.617Z","repository":{"id":57343739,"uuid":"104605817","full_name":"SpencerTorres/react-route-props","owner":"SpencerTorres","description":"A react router route for passing props to the specified component.","archived":false,"fork":false,"pushed_at":"2017-09-24T05:22:34.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-10T21:05:51.335Z","etag":null,"topics":["javascript","jsx","props","react","react-component","react-router","react-router-v4","reactjs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-route-props","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SpencerTorres.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-09-23T23:38:15.000Z","updated_at":"2017-10-26T17:23:36.000Z","dependencies_parsed_at":"2022-09-12T06:30:28.819Z","dependency_job_id":null,"html_url":"https://github.com/SpencerTorres/react-route-props","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/SpencerTorres%2Freact-route-props","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpencerTorres%2Freact-route-props/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpencerTorres%2Freact-route-props/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpencerTorres%2Freact-route-props/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpencerTorres","download_url":"https://codeload.github.com/SpencerTorres/react-route-props/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241020126,"owners_count":19895372,"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":["javascript","jsx","props","react","react-component","react-router","react-router-v4","reactjs"],"created_at":"2024-11-11T21:23:13.987Z","updated_at":"2025-12-31T01:13:14.674Z","avatar_url":"https://github.com/SpencerTorres.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-route-props\n\nThis package is for easily passing extra props into react router's `Route` component. It adds a new component called `RouteProps` for achieving this.\n\n## Install\n\n**NPM**\n```\nnpm install react-route-props\n```\n**Yarn**\n```\nyarn add react-route-props\n```\n\n## Usage\n\n```JSX\nimport { Component } from 'react'\nimport { Route, Switch, Redirect } from 'react-router-dom'\n\nimport RouteProps from 'react-route-props'\n\nimport SomeStandaloneComponent from './SomeStandaloneComponent'\nimport SomeComponentWithProps from './SomeComponentWithProps'\n\nexport default class App extends Component {\n  render() {\n    return (\n      \u003cSwitch\u003e\n        \u003cRoute path='/' component={SomeStandaloneComponent}/\u003e\n        \u003cRouteProps path='/route' component={SomeComponentWithProps} someProps={'Stringy String'} moreProps={5}/\u003e\n        \u003cRouteProps exact path='/another' component={SomeComponentWithProps} someProps={'Example String'}/\u003e\n        \u003cRouteProps component={Redirect} to={'/'}/\u003e\n      \u003c/Switch\u003e\n    )\n  }\n}\n```\n\n`RouteProps` is just like `Route` with the difference of being able to pass extra props to the given `component`. Be careful with conflicting prop names for `Route`. You should add `Route` props to the left of the `component` prop as seen above with the `exact` prop.\n\nThere may be better ways to approach this, but this works for my projects using `react-router-v4`.\n\n## License\nreact-route-props is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspencertorres%2Freact-route-props","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspencertorres%2Freact-route-props","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspencertorres%2Freact-route-props/lists"}