{"id":15383307,"url":"https://github.com/neolegends/babel-plugin-transform-react-create-element","last_synced_at":"2026-04-30T16:33:34.312Z","repository":{"id":70011001,"uuid":"256250851","full_name":"NeoLegends/babel-plugin-transform-react-create-element","owner":"NeoLegends","description":"Shorten JSX `React.createElement` calls using a local variable","archived":false,"fork":false,"pushed_at":"2020-04-20T11:34:38.000Z","size":153,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-30T16:33:33.968Z","etag":null,"topics":["babel-plugin","jsx","react"],"latest_commit_sha":null,"homepage":null,"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/NeoLegends.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,"zenodo":null}},"created_at":"2020-04-16T15:11:58.000Z","updated_at":"2020-04-20T11:34:09.000Z","dependencies_parsed_at":"2023-02-22T18:45:54.236Z","dependency_job_id":null,"html_url":"https://github.com/NeoLegends/babel-plugin-transform-react-create-element","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/NeoLegends/babel-plugin-transform-react-create-element","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoLegends%2Fbabel-plugin-transform-react-create-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoLegends%2Fbabel-plugin-transform-react-create-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoLegends%2Fbabel-plugin-transform-react-create-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoLegends%2Fbabel-plugin-transform-react-create-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NeoLegends","download_url":"https://codeload.github.com/NeoLegends/babel-plugin-transform-react-create-element/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoLegends%2Fbabel-plugin-transform-react-create-element/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32470879,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-plugin","jsx","react"],"created_at":"2024-10-01T14:36:51.127Z","updated_at":"2026-04-30T16:33:34.300Z","avatar_url":"https://github.com/NeoLegends.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-plugin-transform-react-create-element\n\nShorten JSX `React.createElement` calls using a local variable.\n\nCompiles\n\n```jsx\nimport React from 'react';\n\nconst Component = () =\u003e (\n  \u003cdiv\u003eHello, World!\u003c/div\u003e\n);\n```\n\nto\n\n```jsx\nimport React from 'react';\n\nconst _createElement = React.createElement;\n\nconst Component = () =\u003e (\n  _createElement('div', {}, 'Hello, World!')\n);\n```\n\ninstead of\n\n```jsx\nimport React from 'react';\n\nconst Component = () =\u003e (\n  React.createElement('div', {}, 'Hello, World!')\n);\n```\n\n## How?\n\nInstall via `npm install -D babel-plugin-transform-react-create-element` or `yarn add -D babel-plugin-transform-react-create-element`.\n\nIn your `.babelrc`:\n\n```\n{\n  \"plugins\": [\n    \"babel-plugin-transform-react-create-element\",\n  ]\n}\n```\n\nIt works by translating any found calls to `React.createElement` to use the newly inserted local variable instead.\n\nAs such, it automatically respects any existing JSX pragmas in the file and does not interfer with their use.\n\n## Why?\n\nPerformance. In particular in conjunction with the way webpack transforms imports.\n\nAlso created to solve https://github.com/facebook/create-react-app/issues/5435.\n\n## License\n\nMIT\n\nLoosely based on https://github.com/facebook/create-react-app/pull/6219.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneolegends%2Fbabel-plugin-transform-react-create-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneolegends%2Fbabel-plugin-transform-react-create-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneolegends%2Fbabel-plugin-transform-react-create-element/lists"}