title: ReactJS: already declared in the upper scope
body: <p>I have declared a variable like</p>
  <pre><code>const [listRealm, setListRealm] = useState([
      {
        value: null,
        label: 'select one',
      },
    ]);
  
    const findList= async () =&gt; {
      await axios.get(`${apiUrl}`).then(resp =&gt; {
        resp.data.map(res =&gt; {
          setListRealm(listRealm =&gt; [...listRealm, { value: res.id, label: res.name}]); // error here
        });
      });
    };
  
  
    useEffect(() =&gt; {
      findList();
    }, []);
  </code></pre>
  <p>Now my problem is that I receive error:</p>
  <blockquote>
  <p>'listRealm' is already declared in the upper scope  @typescript-eslint/no-shadow</p>
  </blockquote>
  <p>I don't understand how I can change name of variable, considering that i'm setting this variable.</p>
  <p>How can I do? thank you</p>