I have this React select dropdown:
const handleSyncList = () => {
......
};
const [exchangeId, setExchangeId] = useState('');
<select onSelect={e => setExchangeId(e.target.value)} onChange={handleSyncList}>
<option value="">All Exchanges</option>
{exchangesList.map(otherEntity => (
<option value={otherEntity.exchangeId}>
.......
</option>
))
: null}
</select>
I need to set the selected value to exchangeId
and call handleSyncList
.
Is it possible first to set the option value and then call handleSyncList
?