'How can I solve react dom warning message?
How to solve this warning message?
react-dom.development.js:86 Warning: Cannot update a component (BrowserRouter
) while rendering a different component (SocialLogin
). To locate the bad setState() call inside SocialLogin
, follow the stack trace as described in https://reactjs.org/link/setstate-in-render.
Solution 1:[1]
You are rendering an element without knowing it is loaded or not. In socialLogin while navigation this problem occurs.
put the navigation inside useEffect() hope this will solve the problem.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | shahriar swapnil |