could you please tell me how to set value in dropdown in react js ? I am getting dropdown data after few seconds 3000 and then I need to set value on dropdown
const App = ({ children }) => {
const val = "ax";
const [state, setState] = useState([]);
setTimeout(() => {
setState(countryOptions);
}, 2000);
return (
<Container style={{ margin: 20 }}>
<Example countryOptions={state} />
</Container>
);
};
https://codesandbox.io/s/semantic-ui-example-utev4 expected output Aland Islands should be selected. { key: "ax", value: "ax", text: "Aland Islands" },
as after three second I want to select this element
const val = "ax";