@builder.io/qwik-react

中文文档
0.5.8发布于 2025/12/17MITTypeScriptESM + CJS零依赖近 30 天下载 6251

QwikReact allows adding React components into existing Qwik application

原始使用文档
文档目录7 节
  1. Development Builds
  2. Client only
  3. Server-side Rendering (SSR) and Client
  4. Production Builds
  5. Client Modules
  6. Server Modules
  7. Related

Qwik qwik-react ⚡️

  • Create a component library
  • Vite.js tooling.
  • Prettier code formatter.

Development Builds

Client only

During development, the index.html is not a result of server-side rendering, but rather the Qwik app is built using client-side JavaScript only. This is ideal for development with Vite and its ability to reload modules quickly and on-demand. However, this mode is only for development and does not showcase "how" Qwik works since JavaScript is required to execute, and Vite imports many development modules for the app to work.

npm run dev

Server-side Rendering (SSR) and Client

Server-side rendered index.html, with client-side modules prefetched and loaded by the browser. This can be used to test out server-side rendered content during development, but will be slower than the client-only development builds.

npm run dev.ssr

Production Builds

A production build should generate the client and server modules by running both client and server build commands.

npm run build

Client Modules

Production build that creates only the client-side modules that are dynamically imported by the browser.

npm run build.client

Server Modules

Production build that creates the server-side render (SSR) module that is used by the server to render the HTML.

npm run build.server

版本与发布记录

@builder.io/qwik-react 共发布 29 个版本,首次发布于 2022/06/22;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.5.8latest2025/12/1710 个月前
0.5.72025/10/091.1 年前
0.5.62025/04/081.6 年前
0.5.52024/07/102 年前
0.5.42024/02/282 年前
0.5.3-devdev2024/02/072 年前

关于 @builder.io/qwik-react 的常见问题

@builder.io/qwik-react 是什么?

QwikReact allows adding React components into existing Qwik application

如何安装 @builder.io/qwik-react?

在项目目录运行 npm install @builder.io/qwik-react,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vite(>=5 <8)、react(^18)、react-dom(^18)、@types/react(^18)、@builder.io/qwik(^1.18.0)、@types/react-dom(^18)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@builder.io/qwik-react 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@builder.io/qwik-react 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@builder.io/qwik-react 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=16.8.0 <18.0.0 || >=18.11。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@builder.io/qwik-react 可以商用吗?

@builder.io/qwik-react 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@builder.io/qwik-react 的下载量有多少?

根据 npm 官方下载统计,@builder.io/qwik-react 在 2026/10/09 – 2026/11/07 这 30 天内被下载 6,251 次,日均约 208 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@builder.io/qwik-react 还在维护吗?

最新版本 0.5.8 发布于 2025/12/17(10 个月前);至今共发布 29 个版本,其中过去 12 个月发布了 1 个;首次发布于 2022/06/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。