I'm using Office UI Fabric React dropdown in my spfx webpart. I have added static options in that dropdown as below, but I want to bind options dynamically which i'm getting from REST api.
<Dropdown
placeholder="Select"
label="Select Location (Lookup)"
id="ddlLocation"
options={[
{ key: 'A', text: 'Option a' },
{ key: 'B', text: 'Option b' },
{ key: 'D', text: 'Option d' },
{ key: 'E', text: 'Option e' }
]}
If I'm not wrong then we have to pass function in options parameter which will return data in that format. If any one know then please help.
Thank you.