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

feat: useToastController should handle toasterId #27902

Conversation

ling1726
Copy link
Member

@ling1726 ling1726 commented May 18, 2023

toasterId can no longer be used from the individual control functions such as dispatchToast.

Instead, the useToastController should be called with the correct toasterId to return controls for a specific toaster. This should promote modular use of the API and encapsulate toaster behaviour better.

before

const { dispatch }  = useToastController();

dispatchToast('toast', { toasterId });

after

const { dispatch }  = useToastController(toasterId);

dispatchToast('toast');

toasterId can no longer be used from the individual control functions
such as `dispatchToast`.

Instead, the useToastController should be called with the correct
toasterId to return controls for a specific toaster. This should promote
modular use of the API and encapsulate toaster behaviour better.
@github-actions github-actions bot added this to the May Project Cycle Q2 2023 milestone May 18, 2023
@ling1726 ling1726 marked this pull request as ready for review May 18, 2023 10:36
@ling1726 ling1726 requested a review from a team as a code owner May 18, 2023 10:36
@fabricteam
Copy link
Collaborator

📊 Bundle size report

🤖 This report was generated against 31930f6a77d0473edea5eefef5acc63c78ff9de1

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0644a37:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@size-auditor
Copy link

size-auditor bot commented May 18, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 31930f6a77d0473edea5eefef5acc63c78ff9de1 (build)

@ling1726 ling1726 merged commit ab53a4c into microsoft:master May 23, 2023
26 checks passed
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 this pull request may close these issues.

None yet

4 participants