MCPcopy Create free account
hub / github.com/shoutem/ui / getSelectedOption

Method getSelectedOption

components/DropDownMenu/DropDownMenu.js:25–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23 }
24
25 getSelectedOption() {
26 const { options, selectedOption } = this.props;
27 if (_.indexOf(options, selectedOption) === -1) {
28 // eslint-disable-next-line no-console
29 console.warn(
30 `Invalid \`selectedOption\` ${JSON.stringify(selectedOption)}, ` +
31 'DropDownMenu `selectedOption` must be a member of `options`.' +
32 'Check that you are using the same reference in both `options` and `selectedOption`.',
33 );
34
35 return null;
36 }
37
38 return selectedOption;
39 }
40
41 collapse() {
42 this.setState({ collapsed: true });

Callers 1

renderSelectedOptionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected