title: How to resolve Maximum update depth exceeded. This can happen when a component repeatedly calls setState stateless component
body: <p>Hi im trying to set the filter value in function level state im getting the below error.</p>
  <pre><code>Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
  </code></pre>
  <p>also attaching the js image</p>
  <p><a href="https://i.stack.imgur.com/4yNd2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4yNd2.png" alt="enter image description here" /></a></p>
  <p>I'm using AutoComple in MUI where I'm using inbuild filter method. I want to get the filtered array out of AutoComplete so I used state to set the value. but I'm getting maximum update depth exceeded. Please any one help me on this I'm new to React.</p>