title: Adding React-Select Dropdown Component on Button Click
body: <p>I am trying to add a component on click of a button. I am using react-select dropdown package.
  I tried with concat but it gives an error and does not adds in the DOM.
  Here is my jsx file</p>
  <pre><code>const LanguageSelect = (props) =&gt; {
      const {options, name, isLanguage} = props;
      const [language, setLanguage] = useState([{ value: '', label: '' }]);
   // Input Change 
      const handleSelectDropdownChange = (selected, index) =&gt; {
          const {value, label} = selected;
          const list = [...inputList];
          list[value, label] = language;
          setLanguage(list);
          console.log(list);
      }
  
      // handle to add language dropdown
      const handleAddClick = () =&gt; {
          setInputList([...inputList, {value: &quot;&quot;, label: &quot;&quot;}]);
          &lt;LanguageSelect options={options} placeholder={placeholder} name={name} isLanguageBlock={isLanguageBlock} title={title} /&gt;
      }
  return (
  &lt;div className=&quot;form-group&quot;&gt;
              &lt;label htmlFor={name} className=&quot;control-label&quot;&gt;{title}&lt;/label&gt;
                  &lt;div className=&quot;form-input-container&quot;&gt;
                      &lt;Select 
                          className=&quot;profile-module-select-container&quot;
                          classNamePrefix=&quot;profile-module-select&quot;
                          options={options}
                          onChange={selected =&gt; {
                              setDropdown({
                                  optionSelect: selected.value
                              });
                              handleSelectDropdownChange(selected, i);
                          }}
                      /&gt;{isLanguage &amp;&amp; (&lt;div className=&quot;add-language-selection&quot;&gt;
                      &lt;a className=&quot;addLanguage&quot; id=&quot;addLanguage&quot; role=&quot;link&quot; onClick={handleAddClick} tabIndex={0}&gt;+Add Language&lt;/a&gt; 
                      &lt;/div&gt;)}
                  &lt;/div&gt;
              &lt;/div&gt;
      )
  }
  </code></pre>