Spaces:
Paused
Paused
Download console/src/hooks/useAppMessage.ts from mysticaldragon/HF: direct link, hf CLI and curl.
- Browser
- Download file 455 Bytes
-
https://huggingface.co/spaces/mysticaldragon/HF/resolve/main/console/src/hooks/useAppMessage.ts
- Command line
-
hf download hf://spaces/mysticaldragon/HF/console/src/hooks/useAppMessage.ts
-
curl -L -o useAppMessage.ts https://huggingface.co/spaces/mysticaldragon/HF/resolve/main/console/src/hooks/useAppMessage.ts
455 Bytes
| import { App } from "antd"; | |
| /** | |
| * Hook to get message instance from Ant Design's App component. | |
| * Use this instead of the static message import to ensure | |
| * message notifications work correctly with ConfigProvider's prefixCls. | |
| * | |
| * Usage: | |
| * const { message } = useAppMessage(); | |
| * message.success('Success!'); | |
| */ | |
| export function useAppMessage() { | |
| const { message, modal, notification } = App.useApp(); | |
| return { message, modal, notification }; | |
| } | |