# All files useRemoveToast.ts

84% Statements 21/25
100% Branches 0/0
0% Functions 0/2
84% Lines 21/25

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    261x
    1x
    1x
    1x

    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x

     import { createContext, useContext } from "react";
    import type { CurrentToastActions } from "./ToastManagerProvider";

    const noop = (): void => {
      // do nothing
    };

    const context = createContext(noop);
    context.displayName = "CurrentToastActions";

    /**
     * @remarks \@since 6.0.0
     * @internal
     */
    export const { Provider: RemoveToastProvider } = context;

    /**
     * This is only required if you have multiple `Snackbar` implementations in your
     * app.
     *
     * @remarks \@since 6.0.0
     */
    export function useCurrentToastActions(): CurrentToastActions {
      return useContext(context);
    }