title: Change several events on onClick in React
body: <p>I have two buttons for changing language created by the .map function. I also use i18next to change languages.</p>
  <p>When clicked on a button corresponding to a certain language, I want not only the language of a page to change, but to change the styling of a button (e.g. make background white).</p>
  <p>I have managed to do the following with useState, however, it changes the ctyling of two buttons simultaneously.</p>
  <p>Code:</p>
  <pre><code>const languages = [
    {
      code: 'en',
      name: 'English',
      country_code: 'gb',
      emoji: ''
    },
  
    {
      code: 'uk',
      name: 'Українська',
      country_code: 'ua',
      emoji: ''
    }
  ]
  
  
  
  const Langbar = () =&gt; {
    const { t, i18n } = useTranslation();
    const [isActive, setIsActive] = useState(false);
  
    const handleClick = () =&gt; {
      setIsActive(current =&gt; !current);
    };
    return (
      &lt;div className='container langbar_container'&gt;
        &lt;h3&gt;{t('language')}&lt;/h3&gt;
      {languages.map(({code, emoji}) =&gt; (
              &lt;button 
              onClick={() =&gt; {i18next.changeLanguage(code); handleClick}}
              className=&quot;btn btn-secondary langbar_btn&quot;
              style={{
                background: isActive ? 'white' : ''}
              }&gt;
                &lt;span&gt;{emoji}&lt;/span&gt;
              &lt;/button&gt;
      ))}
  &lt;/div&gt;
    )
  }
  </code></pre>