Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ahmad6242 opened this issue Jul 12, 2022 · 2 comments
Open

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

ahmad6242 opened this issue Jul 12, 2022 · 2 comments

Comments

@ahmad6242
Copy link

ahmad6242 commented Jul 12, 2022

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
@GA-MO
Copy link
Owner

GA-MO commented Jul 12, 2022

@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

@gustavoghp87
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants