react-confirm-alert
react-confirm-alert copied to clipboard
How can i use this in a functional component in REACT?
I want to use this in a functional component in react but i am getting this ERROR the second time First time nothing is happening ! what should i do
react-dom.development.js:86 Warning: You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it
@ahmad6242
Upgrade your react
to be version 18.x.x or use react-confirm-alert
version 2.x.x for react <= 17.x.x
About this warning (You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before.), it seems to be caused by React's strict mode (index.js file), which mounts the component 2 times at a time to do checks. It would have no other consequences.