Skip to content

Commit 99579d8

Browse files
authored
docs: fix JSX import source reference in documentation (#6614)
1 parent 06cf931 commit 99579d8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

website/docs/en/guide/framework/react.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ See [CSS-in-JS](/guide/styling/css-in-js) for how to use CSS-in-JS in Rsbuild.
175175

176176
Rsbuild uses SWC to compile JSX. You can customize the functions used by the compiled JSX code:
177177

178-
- If the JSX runtime is `automatic`, use [jsxImportSource](/plugins/list/plugin-react#swcreactoptionsimportsource) to customize the import path of the JSX runtime, for example, import from Preact or Emotion.
178+
- If the JSX runtime is `automatic`, use [importSource](/plugins/list/plugin-react#swcreactoptionsimportsource) to customize the import path of the JSX runtime, for example, import from Preact or Emotion.
179179
- If the JSX runtime is `classic`, use `pragma` and `pragmaFrag` to specify the JSX function and Fragment component.
180180

181181
> `@rsbuild/plugin-react` uses `automatic` as the default JSX runtime, see [swcReactOptions.runtime](/plugins/list/plugin-react#swcreactoptionsruntime).
@@ -195,7 +195,7 @@ export default defineConfig({
195195
pluginReact({
196196
swcReactOptions: {
197197
runtime: 'automatic',
198-
jsxImportSource: '@emotion/react',
198+
importSource: '@emotion/react',
199199
},
200200
}),
201201
],

website/docs/zh/guide/framework/react.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ TanStack Router 提供了 `@tanstack/router-plugin` 来与 Rsbuild 集成,该
175175

176176
Rsbuild 使用 SWC 来编译 JSX,你可以自定义编译后的 JSX 代码所使用的函数:
177177

178-
- 当 JSX 的 runtime 为 `automatic` 时,使用 [jsxImportSource](/plugins/list/plugin-react#swcreactoptionsimportsource) 来自定义 JSX runtime 的导入路径,比如从 Preact 或 Emotion 中引入。
178+
- 当 JSX 的 runtime 为 `automatic` 时,使用 [importSource](/plugins/list/plugin-react#swcreactoptionsimportsource) 来自定义 JSX runtime 的导入路径,比如从 Preact 或 Emotion 中引入。
179179
- 当 JSX 的 runtime 为 `classic` 时,使用 `pragma``pragmaFrag` 来指定 JSX 函数和 Fragment 组件。
180180

181181
> `@rsbuild/plugin-react` 默认使用的 JSX runtime 为 `automatic`,详见 [swcReactOptions.runtime](/plugins/list/plugin-react#swcreactoptionsruntime)
@@ -195,7 +195,7 @@ export default defineConfig({
195195
pluginReact({
196196
swcReactOptions: {
197197
runtime: 'automatic',
198-
jsxImportSource: '@emotion/react',
198+
importSource: '@emotion/react',
199199
},
200200
}),
201201
],

0 commit comments

Comments
 (0)