title: how to make my Popup appear in reactJS automatically upon selecting an option? Leaflet-js
body: <p><strong>I am using Leaflet JS</strong></p>
  <pre><code>export const showDataOnMap = (data, casesType ='cases', selectedCountry) =&gt; 
  data.map(country =&gt; (
      &lt;Circle
          center={[country.countryInfo.lat, country.countryInfo.long]}
          fillOpacity={0.4}
          pathOptions={country.countryInfo.iso2 === selectedCountry
                          ? casesTypeColors[casesType].highlight /* if selectedCountry then highlight circle! */
                          : casesTypeColors[casesType].option
          }   
          
      radius = {
          Math.sqrt(country[casesType]) * casesTypeColors[casesType].multiplier / 2
      }
      &gt;
      
      &lt;Popup popupopen={country.countryInfo.iso2 === selectedCountry ? Popup.openPopup()}&gt;
          &lt;div className=&quot;info-container&quot;&gt;
              &lt;div
                  className='info-flag'
                  style={{backgroundImage: `url(${country.countryInfo.flag})`}}
              /&gt;
              &lt;div className='info-name'&gt;{country.country}&lt;/div&gt;
              &lt;div className='info-cases'&gt;Cases: {numeral(country.cases).format(&quot;0,0&quot;)}&lt;/div&gt;
              &lt;div className='info-recovered'&gt;Recovered: {numeral(country.recovered).format(&quot;0,0&quot;)}&lt;/div&gt;
              &lt;div className='info-deaths'&gt;Deaths: {numeral(country.deaths).format(&quot;0,0&quot;)}&lt;/div&gt;
          &lt;/div&gt;
      &lt;/Popup&gt;
  &lt;/Circle&gt;
  </code></pre>
  <p>When i select an option from my dropdown menu, aka &quot;country.countryInfo.iso2 === selectedCountry&quot;, I would like for my  that is within my  component to appear immediately. However, i am not exactly sure how to use the .openPopup method into a component. I basically just want the pop up to appear the moment the condition &quot;country.countryInfo.iso2 === selectedCountry&quot; is true.</p>
  <p><strong>I am using Leaflet JS</strong></p>