How to use the @react-md/alert.useQueue function in @react-md/alert

To help you get started, we’ve selected a few @react-md/alert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mlaursen / react-md / packages / documentation / src / components / Demos / Alert / UpdatingMessagePriority.tsx View on Github external
const UpdatingMessagePriority: FC = () => {
  const addMessage = useAddMessage();
  const [priority, handlePriorityChange] = useChoice("next");
  const queue = useQueue();
  const [running, setRunning] = useState(false);

  if (running && !queue.length) {
    setRunning(false);
  }

  const exampleNextFlow = useCallback(() => {
    addMessage({
      messageId: "message-1",
      children: "First normal message",
      messagePriority: "normal",
    });
    addMessage({
      messageId: "message-2",
      children: "Second normal message",
      messagePriority: "normal",
github mlaursen / react-md / packages / documentation / components / Demos / Alert / UpdatingMessagePriority.tsx View on Github external
const UpdatingMessagePriority: FC = () => {
  const addMessage = useAddMessage();
  const [priority, handlePriorityChange] = useChoice("next");
  const queue = useQueue();
  const [running, setRunning] = useState(false);

  if (running && !queue.length) {
    setRunning(false);
  }

  const exampleNextFlow = useCallback(() => {
    addMessage({
      messageId: "message-1",
      children: "First normal message",
      messagePriority: "normal",
    });
    addMessage({
      messageId: "message-2",
      children: "Second normal message",
      messagePriority: "normal",

@react-md/alert

Create accessible alerts through snackbars and banners.

MIT
Latest version published 1 year ago

Package Health Score

60 / 100
Full package analysis