react-confirm-alert icon indicating copy to clipboard operation
react-confirm-alert copied to clipboard

How can i use this in a functional component in REACT?

Open ahmad6242 opened this issue 2 years ago • 2 comments

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 avatar Jul 12 '22 09:07 ahmad6242

@ahmad6242 Upgrade your react to be version 18.x.x or use react-confirm-alert version 2.x.x for react <= 17.x.x

Demo with functional component

GA-MO avatar Jul 12 '22 10:07 GA-MO

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.

gustavoghp87 avatar Apr 10 '23 02:04 gustavoghp87