title: How to change background color of button using react
body: <p>I am working on react using bootstrap, initially I am giving same colors to my buttons, now What I am trying to do is on click of button change that button's color and if I click on other button it change the color of that and the first one back to basic (default) color</p>
  
  <p>I have done this using jquery earlier as passing onclick event and toggle the color but here I am new to react so don't know how to do that.</p>
  
  <p>My code</p>
  
  <p><a href="https://codesandbox.io/s/relaxed-brook-en64x?file=/src/App.js" rel="nofollow noreferrer">code sandbox</a></p>
  
  <p><strong>What I am looking for</strong> is suppose I have 7 buttons and I click on first one then its color should change , then If I am clicking on next button then first should come to normal and the clicked (second) one should changed the color.</p>
  
  <p><strong>Important</strong> the first button should always be in active mode i.e it should have the active color then if next clicked that color changes to normal and the clicked one should take the color</p>
  
  <pre><code>import React from 'react'
  
  function Stddata() {
      const button_Data = [
        {
          "name": "Name",
          "value": "name"
        },
        {
          "name": "Class",
          "value": "class"
        },
        {
          "name": "Age",
          "value": "age"
        },
        {
          "name": "Subjects",
          "value": "subjects"
        },
        {
          "name": "School",
          "value": "school"
        }
      ]
      return (
          &lt;div&gt;
              { button_Data.map(item =&gt; (
                  &lt;div key={item.value}&gt;
              &lt;button 
                  className="btn btn-outline-secondary mb-1 form-control text-left"
                  value={item.value}
                  onClick={props.trigerOnClickEmpSideBtn}
              &gt;{item.name}&lt;/button&gt;
              &lt;/div&gt;
              ))}   
          &lt;/div&gt;
      )
  }
  
  export default Stddata
  </code></pre>