Skip to content

Commit 53c5639

Browse files
chore: release 1.14.5 (#3765)
* chore: release 1.14.5 * chore: changelog's changes * chore: update CHANGELOG * chore: optimize * chore: update CHANGELOG --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 5500d6f commit 53c5639

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

packages/components/hooks/useVariables.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ function useVariables<T extends Record<string, string>>(
3131
): Record<keyof T, string> {
3232
const [, forceUpdate] = useState<Record<string, never>>({});
3333

34-
// @ts-expect-error
35-
if (!canUseDocument) return {};
36-
37-
if (!targetElement) {
34+
if (canUseDocument && !targetElement) {
3835
// eslint-disable-next-line no-param-reassign
3936
targetElement = document?.documentElement;
4037
}
@@ -44,7 +41,6 @@ function useVariables<T extends Record<string, string>>(
4441
throw new Error('useVariables: variables parameter cannot be empty');
4542
}
4643

47-
// eslint-disable-next-line react-hooks/rules-of-hooks
4844
const refs = useMemo(() => {
4945
const values = {} as Record<keyof T, string>;
5046

@@ -77,7 +73,6 @@ function useVariables<T extends Record<string, string>>(
7773
}
7874
};
7975

80-
// eslint-disable-next-line react-hooks/rules-of-hooks
8176
useMutationObservable(
8277
targetElement,
8378
(mutationsList) => {
@@ -92,6 +87,9 @@ function useVariables<T extends Record<string, string>>(
9287
DEFAULT_OPTIONS,
9388
);
9489

90+
// @ts-expect-error
91+
if (!canUseDocument) return {};
92+
9593
return refs;
9694
}
9795

packages/tdesign-react/CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ toc: false
55
spline: explain
66
---
77

8-
## 🌈 1.14.4 `2025-08-26`
8+
## 🌈 1.14.5 `2025-08-26`
99
### 🐞 Bug Fixes
10-
- `fix`: 修复 SSR 渲染的相关问题 @uyarn ([#3762](https://github.com/Tencent/tdesign-react/pull/3762))
10+
- `Watermark`: 完善水印组件在 SSR 场景的兼容问题 @uyarn ([#3765](https://github.com/Tencent/tdesign-react/pull/3765))
1111

1212
## 🌈 1.14.3 `2025-08-26`
1313
### 🐞 Bug Fixes
@@ -1229,3 +1229,5 @@ spline: explain
12291229

12301230
## 🌈 0.x `2021-03-26 - 2023-02-08`
12311231
前往 [GitHub](https://github.com/Tencent/tdesign-react/blob/develop/packages/tdesign-react/CHANGELOG-0.x.md) 查看 `0.x` 更新日志
1232+
1233+

packages/tdesign-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tdesign-react",
3-
"version": "1.14.4",
3+
"version": "1.14.5",
44
"title": "tdesign-react",
55
"description": "TDesign Component for React",
66
"main": "lib/index.js",

0 commit comments

Comments
 (0)