React Grommet Select - passing in object data as options React Grommet Select - passing in object data as options reactjs reactjs

React Grommet Select - passing in object data as options


            <Select              options={[                {                  lab: "S01",                  val: "283736"                },                {                  lab: "S02",                  value: "293774"                }              ]}              labelKey="lab"              dropHeight="large"              name="primaryServer"              value={this.props.values.primaryServer}              placeholder="Select Primary Server"              emptySearchMessage={"No Servers Available"}              onChange={({ option }) => {                console.log(option.lab)                console.log(option.val)              }}            />            // Output // S01 // 283736            // This worked for me. labelKey="lab" is required.