diff --git a/change/@fluentui-react-message-bar-dcc6ade3-1e4b-44ab-b29b-14b1cafc1320.json b/change/@fluentui-react-message-bar-dcc6ade3-1e4b-44ab-b29b-14b1cafc1320.json new file mode 100644 index 0000000000000..99463dfdba879 --- /dev/null +++ b/change/@fluentui-react-message-bar-dcc6ade3-1e4b-44ab-b29b-14b1cafc1320.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore(react-message-bar): Use useAnnounce() instead of the deprecated useAnnounce_unstable()", + "packageName": "@fluentui/react-message-bar", + "email": "jiangemma@microsoft.com", + "dependentChangeType": "none" +} diff --git a/packages/react-components/react-message-bar/library/src/components/MessageBar/useMessageBar.ts b/packages/react-components/react-message-bar/library/src/components/MessageBar/useMessageBar.ts index 5dcd0040e9f00..cb2e0e7f1bc25 100644 --- a/packages/react-components/react-message-bar/library/src/components/MessageBar/useMessageBar.ts +++ b/packages/react-components/react-message-bar/library/src/components/MessageBar/useMessageBar.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { getIntrinsicElementProps, slot, useId, useMergedRefs } from '@fluentui/react-utilities'; -import { useAnnounce_unstable } from '@fluentui/react-shared-contexts'; +import { useAnnounce } from '@fluentui/react-shared-contexts'; import type { MessageBarProps, MessageBarState } from './MessageBar.types'; import { getIntentIcon } from './getIntentIcon'; import { useMessageBarReflow } from './useMessageBarReflow'; @@ -24,7 +24,7 @@ export const useMessageBar_unstable = (props: MessageBarProps, ref: React.Ref(null); const bodyRef = React.useRef(null); - const { announce } = useAnnounce_unstable(); + const { announce } = useAnnounce(); const titleId = useId(); React.useEffect(() => {