sweetalert2 / sweetalert2-react-content

Official SweetAlert2 enhancer adding support for React elements as content
MIT License
689 stars 47 forks source link

react-query #250

Open SnowRunescape opened 9 months ago

SnowRunescape commented 9 months ago

Describe the bug

Uncaught Error: No QueryClient set, use QueryClientProvider to set one

call

    withReactContent(Swal).fire({
      showConfirmButton: false,
      html: <ModalPaymentsGateways />,
    });

component

import { useGetGateways } from "./../../services/gateways";

const ModalPaymentsGateways = () => {
  const { data: gateways} = useGetGateways();

  return (
    <div>
        {gateways.map(gateway => <>
          <div className="flex bg-gray-100 rounded p-3">
            {gateway}
          </div>
        </>)}
    </div>
  );
}

export default ModalPaymentsGateways;`

Unless it's obvious, we also need:

  1. Steps to test
  2. Expected result
  3. Actual result

Additional context

Add any other context about the problem here.