I'm playing around with React and I am getting the functionality I want but it is extremely slow due to an infinite loop somewhere. I believe it's in the component lifecycle methods but I'm not sure how to reformat the below code to have the same functionality but without the infinite loop. Any advice on best practices would be appreciated.I'm playing around with React and I am getting