{"id":30181110,"url":"https://github.com/jaredlunde/forward-ref-as","last_synced_at":"2025-08-12T08:07:33.584Z","repository":{"id":40811397,"uuid":"282487745","full_name":"jaredLunde/forward-ref-as","owner":"jaredLunde","description":"A wrapper around React.forwardRef() that allows HTML attributes and prop types to be derived from the \"as\" prop.","archived":false,"fork":false,"pushed_at":"2023-01-06T12:26:07.000Z","size":2375,"stargazers_count":23,"open_issues_count":15,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-08T22:52:03.842Z","etag":null,"topics":["as-prop","forwardref","polymorphic","polymorphic-component","react","react-utils"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jaredLunde.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":"2020-07-25T17:00:09.000Z","updated_at":"2024-07-15T11:52:36.000Z","dependencies_parsed_at":"2023-02-06T02:01:45.156Z","dependency_job_id":null,"html_url":"https://github.com/jaredLunde/forward-ref-as","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/jaredLunde/forward-ref-as","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredLunde%2Fforward-ref-as","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredLunde%2Fforward-ref-as/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredLunde%2Fforward-ref-as/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredLunde%2Fforward-ref-as/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaredLunde","download_url":"https://codeload.github.com/jaredLunde/forward-ref-as/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredLunde%2Fforward-ref-as/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270024697,"owners_count":24514054,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["as-prop","forwardref","polymorphic","polymorphic-component","react","react-utils"],"created_at":"2025-08-12T08:06:54.889Z","updated_at":"2025-08-12T08:07:33.572Z","avatar_url":"https://github.com/jaredLunde.png","language":"TypeScript","readme":"\u003chr\u003e\n\u003cdiv\u003e\n  \u003ch1\u003e\n    forwardRefAs()\n  \u003c/h1\u003e\n\u003c/div\u003e\n\n\u003cblockquote\u003e\nA wrapper around \u003ccode\u003eReact.forwardRef()\u003c/code\u003e that allows HTML attributes and prop types to\nbe inferred from an \u003ccode\u003eas\u003c/code\u003e prop.\n\u003c/blockquote\u003e\n\n\u003cpre\u003enpm i forward-ref-as\u003c/pre\u003e\n\n\u003cp\u003e\n  \u003ca href=\"https://bundlephobia.com/result?p=forward-ref-as\"\u003e\n    \u003cimg alt=\"Bundlephobia\" src=\"https://img.shields.io/bundlephobia/minzip/forward-ref-as?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"Types\" href=\"https://www.npmjs.com/package/forward-ref-as\"\u003e\n    \u003cimg alt=\"Types\" src=\"https://img.shields.io/npm/types/forward-ref-as?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"Code coverage report\" href=\"https://codecov.io/gh/jaredLunde/forward-ref-as\"\u003e\n    \u003cimg alt=\"Code coverage\" src=\"https://img.shields.io/codecov/c/gh/jaredLunde/forward-ref-as?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"Build status\" href=\"https://travis-ci.com/jaredLunde/forward-ref-as\"\u003e\n    \u003cimg alt=\"Build status\" src=\"https://img.shields.io/travis/com/jaredLunde/forward-ref-as?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"NPM version\" href=\"https://www.npmjs.com/package/forward-ref-as\"\u003e\n    \u003cimg alt=\"NPM Version\" src=\"https://img.shields.io/npm/v/forward-ref-as?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"License\" href=\"https://jaredlunde.mit-license.org/\"\u003e\n    \u003cimg alt=\"MIT License\" src=\"https://img.shields.io/npm/l/forward-ref-as?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003chr\u003e\n\n## Quick start\n\n```tsx\nimport forwardRefAs from 'forward-ref-as'\n\n// Forwards `ref` to the underlying button and adds strong\n// types for the `as` prop.\nconst Button = forwardRefAs\u003c'button', ButtonProps\u003e(\n  ({as: As = 'button', ...props}, ref) =\u003e \u003cAs ref={ref} {...props} /\u003e\n)\n\n// ✅ Will pass type checking and autocomplete correctly\n;\u003cButton as='a' href='https://jaredLunde.com' /\u003e\n```\n\n## API\n\n### forwardRefAs()\n\nA wrapper around `React.forwardRef()` with the same call signature, but\na type signature that allows `as` prop HTML attributes and React prop types\nto be inferred.\n\n## LICENSE\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredlunde%2Fforward-ref-as","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaredlunde%2Fforward-ref-as","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredlunde%2Fforward-ref-as/lists"}