想在整个应用的入口做些事件监听,但我找不到类似的钩子去实现 #12868
-
如题,umi 的设计模式是按约定式进行开发,现在我想在应用的入口处做些全局状态监听,比如监听屏幕尺寸变化,但我不能像传统 react 应用那样在入口组件 app.tsx 里进行操作,请问我在 umi 里可以怎么做? |
Beta Was this translation helpful? Give feedback.
Answered by
xierenyuan
Jan 9, 2025
Replies: 1 comment
-
可以使用 global.tsx https://umijs.org/docs/guides/directory-structure#globaljtsx |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
xiaohuoni
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
可以使用 global.tsx https://umijs.org/docs/guides/directory-structure#globaljtsx