From 49e438ff1be873148a90e228938a82c75c7587b5 Mon Sep 17 00:00:00 2001 From: Uyarn Date: Tue, 15 Oct 2024 11:57:56 +0800 Subject: [PATCH] docs: update usage docs for nextjs --- site/docs/getting-started.en-US.md | 3 +++ site/docs/getting-started.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/site/docs/getting-started.en-US.md b/site/docs/getting-started.en-US.md index 519a237bde..5b500f5acb 100644 --- a/site/docs/getting-started.en-US.md +++ b/site/docs/getting-started.en-US.md @@ -18,6 +18,7 @@ npm i tdesign-react ``` + > Please note that unpkg usage is not recommended as it will download the entire component library. Production projects will be directly affected by version updates, and may also be affected by the stability of the CDN. The package of tdesign-react provides kinds of bundles, read [the documentation](https://github.com/Tencent/tdesign/blob/main/docs/develop-install.md) for the detail of differences between bundles. @@ -92,6 +93,8 @@ module.exports = { When using Next.js, you need to adjust how you use these components. ```js +'use client' + import { Button } from 'tdesign-react/lib/'; import 'tdesign-react/dist/tdesign.css'; ``` diff --git a/site/docs/getting-started.md b/site/docs/getting-started.md index 21e05c313f..21a90fbf5e 100644 --- a/site/docs/getting-started.md +++ b/site/docs/getting-started.md @@ -22,6 +22,7 @@ npm i tdesign-react ``` + > 请注意,我们不推荐使用这种方式,这样无法实现按需加载等优化手段,生产项目会直接受版本更新影响,同时也可能受到 CDN 的稳定性的影响。 npm package 中提供了多种构建产物,可以阅读 [这里](https://github.com/Tencent/tdesign/blob/main/docs/develop-install.md) 了解不同目录下产物的差别。 @@ -96,6 +97,8 @@ module.exports = { 所以在 `next.js` 中需要调整下使用方式: ```js +'use client' + import { Button } from 'tdesign-react/lib/'; // 按需引入无样式组件代码 import 'tdesign-react/dist/tdesign.css'; // 全局引入所有组件样式代码 ```