{"id":22899757,"url":"https://github.com/follgad/vanilla-jsx","last_synced_at":"2026-05-02T19:35:12.700Z","repository":{"id":57286608,"uuid":"387279499","full_name":"FOLLGAD/vanilla-jsx","owner":"FOLLGAD","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-23T19:11:59.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T13:03:59.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FOLLGAD.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-18T22:17:12.000Z","updated_at":"2021-07-23T19:12:01.000Z","dependencies_parsed_at":"2022-09-09T23:10:17.564Z","dependency_job_id":null,"html_url":"https://github.com/FOLLGAD/vanilla-jsx","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/FOLLGAD%2Fvanilla-jsx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FOLLGAD%2Fvanilla-jsx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FOLLGAD%2Fvanilla-jsx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FOLLGAD%2Fvanilla-jsx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FOLLGAD","download_url":"https://codeload.github.com/FOLLGAD/vanilla-jsx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246399793,"owners_count":20770908,"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":[],"created_at":"2024-12-14T01:16:26.665Z","updated_at":"2026-05-02T19:35:12.651Z","avatar_url":"https://github.com/FOLLGAD.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSX to JS — Use JSX without react\n\n[https://mikofilas.netlify.app/blog/jsx-without-react](https://mikofilas.netlify.app/blog/jsx-without-react)\n\n## Installation and setup\n\n```bash\n$ npm i jsx2js @babel/plugin-transform-react-jsx\n```\n\nEdit `babel.config.js` or `.babelrc`:\n\n```js\n{\n  // ...\n  \"plugins\": [\n    // ...\n    [\n      \"@babel/plugin-transform-react-jsx\",\n      {\n        \"runtime\": \"automatic\",\n        \"importSource\": \"jsx2js\"\n      }\n    ]\n  ]\n}\n```\n\nNow you're ready to start writing JSX!\n\n## Example\n\n```jsx\nconst ExampleComponent = ({\n  children,\n  title = 'Default title',\n  ...props\n}) =\u003e {\n  return (\n    \u003cdiv class=\"component\" {...props}\u003e\n      \u003ch2\u003e{title}\u003c/h2\u003e\n      \u003cdiv\u003e{children}\u003c/div\u003e\n    \u003c/div\u003e\n  );\n};\n\nconst Counter = ({}) =\u003e {\n  let clicks = 0\n  const clickSpan = \u003cspan\u003e0\u003c/span\u003e\n  const increment = () =\u003e {\n    clicks++\n    clickSpan.innerText = clicks\n  }\n  const button = (\n    \u003cbutton\u003e\n      Clicked {clickSpan} times\n    \u003c/button\u003e\n  )\n  button.addEventListener(\"click\", increment)\n\n  return button\n}\n\ndocument.body.append(\n  \u003cdiv\u003e\n    \u003cExampleComponent title=\"JSX without React\"\u003e\n      \u003cp\u003eExample child\u003c/p\u003e\n    \u003c/ExampleComponent\u003e\n\n    \u003cCounter /\u003e\n\n    \u003cp\u003eIt just works\u003c/p\u003e\n  \u003c/div\u003e\n)\n```\n\nDemo here: https://codesandbox.io/s/nostalgic-architecture-kv47z?file=/src/index.jsx\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffollgad%2Fvanilla-jsx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffollgad%2Fvanilla-jsx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffollgad%2Fvanilla-jsx/lists"}