'Cannot update a component (`BrowserRouter`) while rendering a different component (`Login`). To locate the bad setState() call inside `Login` [closed]
Solution 1:[1]
This warning was introduced since React V16
If you are using functional components you could wrap the setState call into useEffect.
// example
useEffect(() => {
// here
},[]);
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 | ParsaJ |
