GA-MO / react-confirm-alert

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

customUI + SWR #94

Open imclint21 opened 5 months ago

imclint21 commented 5 months 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 5 months 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