Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n(zh-cn): Update react.mdx #10831

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/content/docs/zh-cn/guides/integrations-guide/react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,26 @@ export default defineConfig({
});
```

### 禁用流式传输(实验性)

默认情况下,Astro 会流式传输 React 组件的输出。但是,你可以通过启用 `experimentalDisableStreaming` 选项来禁用该行为。这对于为不能很好地与流式传输一起使用的库(如某些 CSS-in-JS 解决方案)提供支持来说,特别有用。

要禁用你项目中的所有 React 组件的流式传输,请使用 `experimentalDisableStreaming: true` 来配置 `@astrojs/react`:

```js title="astro.config.mjs" ins={8}
import { defineConfig } from 'astro/config';
import react from '@astrojs/react';

export default defineConfig({
// ...
integrations: [
react({
experimentalDisableStreaming: true,
}),
],
});
```

[astro-integration]: /zh-cn/guides/integrations-guide/

[astro-ui-frameworks]: /zh-cn/guides/framework-components/#使用框架组件