GA-MO / react-confirm-alert

react component confirm dialog.
https://ga-mo.github.io/react-confirm-alert/demo/
MIT License
271 stars 105 forks source link

customUI + SWR #94

Open imclint21 opened 1 month ago

imclint21 commented 1 month ago

Hi,

I open a dialog using confirmAlert and inside my DialogCreate I have an SWR hook, but it's never called, weird.

Something that I need to know?

onClick={() => confirmAlert({
    customUI: ({ onClose }) => <DialogCreate onClose={onClose}/>
})}

Regards

imclint21 commented 1 month ago

Update:

After setting the fetcher it works:

const fetcher = url => axios.get(url).then(res => res.data);

I guess its a problem with the scope of SWRConfig