I am using react-dual-listbox. Here I am able to select the columns and deselect and use the selected values. But, I want to access the selected option in selected items on click of that particular item. Ex: if 2 options are selected. If i click on second one, It should give me the value and index of the selected option. I saw something to use selectedRef for that purpose, But I am new to React.
Could anyone please help me out.

<DualListBox 
            canFilter
            preserveSelectOrder 
            options={this.state.availableColumns}
            selected={selectedColumns}
            onClick={this.selectedRef}
            onChange={this.onColumnSelected}
          />

0 Answers