{"id":19857458,"url":"https://github.com/qwikdev/qwik-preact","last_synced_at":"2025-05-02T02:30:35.979Z","repository":{"id":177869099,"uuid":"660990458","full_name":"QwikDev/qwik-preact","owner":"QwikDev","description":"QwikPreact allows adding Preact components into existing Qwik application","archived":false,"fork":false,"pushed_at":"2023-07-02T13:25:43.000Z","size":75,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-28T01:35:07.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/QwikDev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-01T12:48:22.000Z","updated_at":"2024-10-06T08:49:36.000Z","dependencies_parsed_at":"2023-07-10T18:15:25.548Z","dependency_job_id":null,"html_url":"https://github.com/QwikDev/qwik-preact","commit_stats":null,"previous_names":["qwikdev/qwik-preact"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QwikDev%2Fqwik-preact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QwikDev%2Fqwik-preact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QwikDev%2Fqwik-preact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QwikDev%2Fqwik-preact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QwikDev","download_url":"https://codeload.github.com/QwikDev/qwik-preact/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251972414,"owners_count":21673600,"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-11-12T14:18:43.977Z","updated_at":"2025-05-02T02:30:34.515Z","avatar_url":"https://github.com/QwikDev.png","language":"TypeScript","readme":"# qwik-preact ⚡️\n\nQwikPreact allows adding Preact components into existing Qwik application\n\n## How to Integrate into a Qwik app\n\nIntegration is pretty much the same as \u003chttps://qwik.builder.io/docs/integrations/react/\u003e.\n\nFirst, install `@qwikdev/qwik-preact` with npm, pnpm or yarn. Instead of `react` and `react-dom`, you will need to install `preact` and `preact-render-to-string`. And don't forgot `/** @jsxImportSource preact */`\n\npreact.tsx\n\n```tsx\n/** @jsxImportSource preact */\nimport { qwikify$ } from '@qwikdev/qwik-preact';\nimport { useState } from 'preact/hooks';\n\n// Create Preact component standard way\nfunction Counter() {\n  const [count, setCount] = useState(0);\n  return (\n    \u003cbutton className=\"preact\" onClick={() =\u003e setCount(count + 1)}\u003e\n      Count: {count}\n    \u003c/button\u003e\n  );\n}\n\n// Convert Preact component to Qwik component\nexport const QCounter = qwikify$(Counter, { eagerness: 'hover' });\n```\n\nindex.tsx\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { QCounter } from './preact';\n\nexport default component$(() =\u003e {\n  return (\n    \u003cmain\u003e\n      \u003cQCounter /\u003e\n    \u003c/main\u003e\n  );\n});\n```\n\nvite.config.ts\n\n```ts\n// vite.config.ts\nimport { qwikPreact } from '@qwikdev/qwik-preact/vite';\n \nexport default defineConfig(() =\u003e {\n   return {\n     ...,\n     plugins: [\n       ..., \n       // The important part\n       qwikPreact()\n     ],\n   };\n});\n```\n\nPlease keep in mind that this is an experimental implementation based on `qwik-react` implementation. So, there might be bugs and unwanted behaviours.\n\n---\n\n## Related\n\n- [Qwik Docs](https://qwik.builder.io/docs/)\n- [Qwik on GitHub](https://github.com/BuilderIO/qwik)\n- [@QwikDev](https://twitter.com/QwikDev)\n- [Discord](https://qwik.builder.io/chat)\n- [Vite](https://vitejs.dev/)\n- [Partytown](https://partytown.builder.io/)\n- [Mitosis](https://github.com/BuilderIO/mitosis)\n- [Builder.io](https://www.builder.io/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqwikdev%2Fqwik-preact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqwikdev%2Fqwik-preact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqwikdev%2Fqwik-preact/lists"}