title: Redux: can't pass API value before fetch
body: <p>I have trobule with loading <code>isApiLoaded</code> from a Redux store. Value in store changes well. I try to pass it to condition in <code>searchingBox</code> component after Enter is pressed. I load <code>isApiLoaded</code> in the other component and it works without any problem, so I guess that's an API problem in <code>if</code> condition.</p>
  <pre><code>import React, { useState } from &quot;react&quot;;
  import &quot;./SearchingBar.css&quot;;
  import { useDispatch, useSelector } from &quot;react-redux&quot;;
  import { getWeather } from &quot;../../store/actions/weatherActions&quot;;
  
  const SearchingBar = ({ shareToggleClass, togglePopupStatus, isApiLoaded }) =&gt; {
    
    const dispatch = useDispatch();
    const [toggleClass, setToggleClass] = useState(false);
    const [query, setQuery] = useState(&quot;&quot;);
    const isApiLoaded = useSelector((state) =&gt; state.weather.isApiLoaded);
  
    const search = (event) =&gt; {
      if (event.key === &quot;Enter&quot;) {
        dispatch(getWeather(query));
        if (query &amp;&amp; isApiLoaded) {
          setToggleClass(true);
          shareToggleClass({ toggleClass });
        } else {
          togglePopupStatus(true);
        }
      }
    };
    return (
      &lt;input
        type=&quot;text&quot;
        placeholder=&quot;Search..&quot;
        className={toggleClass ? &quot;Active&quot; : &quot;unActive&quot;}
        onChange={(e) =&gt; setQuery(e.target.value)}
        value={query}
        onKeyPress={search}
      /&gt;
    );
  };
  
  export default SearchingBar;
  
  </code></pre>