Skip to content

Commit

Permalink
[REVERT ME] Docs example of empty initial value
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Aug 26, 2021
1 parent 36542d3 commit a6076bc
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src-docs/src/views/super_select/super_select_basic.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import React, { useState } from 'react';

import { EuiSuperSelect, EuiHealth } from '../../../../src/components';
import {
EuiSuperSelect,
EuiHealth,
EuiFormRow,
} from '../../../../src/components';

export default () => {
const options = [
Expand Down Expand Up @@ -33,17 +37,19 @@ export default () => {
'data-test-subj': 'option-critical',
},
];
const [value, setValue] = useState(options[1].value);
const [value, setValue] = useState();

const onChange = (value) => {
setValue(value);
};

return (
<EuiSuperSelect
options={options}
valueOfSelected={value}
onChange={(value) => onChange(value)}
/>
<EuiFormRow label="Select an EuiHealth">
<EuiSuperSelect
options={options}
valueOfSelected={value}
onChange={(value) => onChange(value)}
/>
</EuiFormRow>
);
};

0 comments on commit a6076bc

Please sign in to comment.