{"id":15800869,"url":"https://github.com/beanloop/react-with-params","last_synced_at":"2026-04-28T20:03:29.640Z","repository":{"id":57146239,"uuid":"85079552","full_name":"beanloop/react-with-params","owner":"beanloop","description":"React HOC for extracting router params.","archived":false,"fork":false,"pushed_at":"2018-10-04T19:44:26.000Z","size":102,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-12T01:17:54.409Z","etag":null,"topics":["higher-order-component","react-router","react-router-v4"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beanloop.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-15T14:05:01.000Z","updated_at":"2018-10-04T19:44:28.000Z","dependencies_parsed_at":"2022-09-05T12:40:09.134Z","dependency_job_id":null,"html_url":"https://github.com/beanloop/react-with-params","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beanloop%2Freact-with-params","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beanloop%2Freact-with-params/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beanloop%2Freact-with-params/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beanloop%2Freact-with-params/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beanloop","download_url":"https://codeload.github.com/beanloop/react-with-params/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246540528,"owners_count":20793930,"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":["higher-order-component","react-router","react-router-v4"],"created_at":"2024-10-05T01:08:12.354Z","updated_at":"2026-04-28T20:03:24.603Z","avatar_url":"https://github.com/beanloop.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-with-params\n[![Build Status](https://travis-ci.org/beanloop/react-with-params.svg?branch=master)](https://travis-ci.org/beanloop/react-with-params)\n[![npm version](https://badge.fury.io/js/react-with-params.svg)](https://badge.fury.io/js/react-with-params)\n[![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)\n\nReact HOC for extracting router params.\n\n## Install\n```\nyarn add react-with-params\nnpm install --save react-with-params\n```\n\n## Usage\n```typescript\nimport Route from 'react-router/Route'\nimport {withParams} from 'react-with-params'\n\nconst ShowName = withParams({params: 'name', match: '/user/:name'})(({name}) =\u003e\n  \u003cspan\u003e{name}\u003c/span\u003e\n)\n\n\u003cRoute exact path='/user/:name' component={ShowName} /\u003e\n```\n\n```typescript\nimport Route from 'react-router/Route'\nimport {withParams} from 'react-with-params'\n\nconst ShowNameAndId = withParams({params: ['name', 'id'], match: '/user/:name/:id'})(({name, id}) =\u003e\n  \u003cspan\u003e{id} - {name}\u003c/span\u003e\n)\n\n\u003cRoute exact path='/user/:name/:id' component={ShowNameAndId} /\u003e\n```\n\n### Query parameters\n```typescript\nimport Route from 'react-router/Route'\nimport {withParams} from 'react-with-params'\n\nconst Display = withParams({\n  queryParams: 'next',\n  match: '/users',\n})(({next}) =\u003e\n  \u003cspan\u003e{next}\u003c/span\u003e\n)\n\n\u003cRoute exact path='/users' component={Display} /\u003e\n```\n\n```typescript\nimport Route from 'react-router/Route'\nimport {withParams} from 'react-with-params'\n\nconst Display = withParams({\n  queryParams: ['next', 'timestamp'],\n  match: '/users',\n})(({next, timestamp}) =\u003e\n  \u003cspan\u003e{next} - {timestamp}\u003c/span\u003e\n)\n\n\u003cRoute exact path='/users' component={Display} /\u003e\n```\n\n## License\nreact-with-params is dual-licensed under Apache 2.0 and MIT\nterms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeanloop%2Freact-with-params","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeanloop%2Freact-with-params","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeanloop%2Freact-with-params/lists"}