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

3.8.2 useTheme 服务端报错问题 #2689

Open
starsion opened this issue Dec 5, 2024 · 2 comments · May be fixed by #2691
Open

3.8.2 useTheme 服务端报错问题 #2689

starsion opened this issue Dec 5, 2024 · 2 comments · May be fixed by #2691

Comments

@starsion
Copy link

starsion commented Dec 5, 2024

版本

3.8.2

问题

在服务端使用ahooks时,由于新增的useThemeAPI 以下代码使用了window变量,导致报错,需要考虑兼容服务端场景。

var matchMedia = window.matchMedia('(prefers-color-scheme: dark)');
@Przeblysk
Copy link

antd 会依赖 ahooks 的最新版本 导致使用 antd 也会报相同的错误 ant-design/ant-design-mobile#6791

@Przeblysk Przeblysk mentioned this issue Dec 5, 2024
18 tasks
@li-jia-nan li-jia-nan linked a pull request Dec 5, 2024 that will close this issue
18 tasks
@crazylxr crazylxr mentioned this issue Dec 5, 2024
18 tasks
@crazylxr
Copy link
Collaborator

crazylxr commented Dec 5, 2024

3.8.4 已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants