this.isStudent() is called from render and can call setState (if the student is not found). In general, render() should not have side effects like that and should only be returning jsx, not doing any other work. The problem here is that setState() itself calls render(), so if render calls setState, there are extra renders happening and it's possible to create an infinite loop of rendering.
I think you could refactor this to move the isStudent() check into componentDidMount() possibly.
facg6-react/src/components/student/index.jsx
Line 81 in 8260691
this.isStudent()is called from render and can call setState (if the student is not found). In general, render() should not have side effects like that and should only be returning jsx, not doing any other work. The problem here is that setState() itself calls render(), so if render calls setState, there are extra renders happening and it's possible to create an infinite loop of rendering.I think you could refactor this to move the isStudent() check into componentDidMount() possibly.