{"id":13739644,"url":"https://github.com/vslinko/babel-plugin-react-require","last_synced_at":"2025-10-03T23:20:44.978Z","repository":{"id":33483409,"uuid":"37129155","full_name":"vslinko/babel-plugin-react-require","owner":"vslinko","description":"Babel plugin that adds React import declaration if file contains JSX tags","archived":false,"fork":false,"pushed_at":"2024-07-23T07:57:00.000Z","size":351,"stargazers_count":158,"open_issues_count":0,"forks_count":15,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-31T13:41:45.347Z","etag":null,"topics":["babel","babel-plugin","react"],"latest_commit_sha":null,"homepage":"","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/vslinko.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-09T11:56:49.000Z","updated_at":"2025-07-30T21:31:33.000Z","dependencies_parsed_at":"2023-01-15T01:06:31.110Z","dependency_job_id":"6529cba6-da39-4135-8c0c-0d0befa4b691","html_url":"https://github.com/vslinko/babel-plugin-react-require","commit_stats":{"total_commits":43,"total_committers":10,"mean_commits":4.3,"dds":0.6046511627906976,"last_synced_commit":"6d6d7802e254b9bff677e4966e299b07d4012be5"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/vslinko/babel-plugin-react-require","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vslinko%2Fbabel-plugin-react-require","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vslinko%2Fbabel-plugin-react-require/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vslinko%2Fbabel-plugin-react-require/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vslinko%2Fbabel-plugin-react-require/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vslinko","download_url":"https://codeload.github.com/vslinko/babel-plugin-react-require/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vslinko%2Fbabel-plugin-react-require/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273838361,"owners_count":25177166,"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-09-05T02:00:09.113Z","response_time":402,"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":["babel","babel-plugin","react"],"created_at":"2024-08-03T04:00:36.087Z","updated_at":"2025-10-03T23:20:44.940Z","avatar_url":"https://github.com/vslinko.png","language":"JavaScript","readme":"# babel-plugin-react-require\n\nBabel plugin that adds React import declaration if file contains JSX tags.\n\nThis plugin is only about stateless components that doesn't extends `React.Component`.\nIf you want to use any other React functions then you should import their by yourself.\n\n## Example\n\nYour `component.js` that contains this code:\n\n```js\nexport default function Component() {\n  return (\n    \u003cdiv /\u003e\n  );\n}\n```\n\nwill be transpiled into something like this:\n\n```js\nimport React from 'react';\n\nexport default function Component() {\n  /* this part will be transpiled by babel itself as usual */\n  return (\n    React.createElement('div')\n  );\n}\n```\n\n## Usage\n\n* Install `babel-plugin-react-require`.\n\n```\nnpm install babel-plugin-react-require --save-dev\n```\n\n* Add `react-require` into `.babelrc`. This plugin should be defined before `transform-es2015-modules-commonjs` plugin because it's using ES2015 modules syntax to import `React` into scope.\n\n```json\n{\n  \"plugins\": [\n    \"react-require\"\n  ]\n}\n```\n","funding_links":[],"categories":["babel","Plugins"],"sub_categories":["非 JavaScript 编译工具","React"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvslinko%2Fbabel-plugin-react-require","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvslinko%2Fbabel-plugin-react-require","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvslinko%2Fbabel-plugin-react-require/lists"}