MCPcopy Create free account
hub / github.com/react-component/select / render

Method render

docs/examples/controlled.tsx:50–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48 };
49
50 render() {
51 const { open, destroy, value } = this.state;
52 if (destroy) {
53 return null;
54 }
55 return (
56 <div style={{ margin: 20 }}>
57 <h2>controlled Select</h2>
58 <div style={{ width: 300 }}>
59 <Select
60 id="my-select"
61 value={value}
62 placeholder="placeholder"
63 listHeight={200}
64 style={{ width: 500 }}
65 onBlur={this.onBlur}
66 onFocus={this.onFocus}
67 open={open}
68 optionLabelProp="children"
69 optionFilterProp="text"
70 onChange={this.onChange}
71 onDropdownVisibleChange={this.onDropdownVisibleChange}
72 >
73 <Option value="01" text="jack" title="jack">
74 <b
75 style={{
76 color: 'red',
77 }}
78 >
79 jack
80 </b>
81 </Option>
82 <Option value="11" text="lucy">
83 lucy
84 </Option>
85 <Option value="21" disabled text="disabled">
86 disabled
87 </Option>
88 <Option value="31" text="yiminghe">
89 yiminghe
90 </Option>
91 {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((i) => (
92 <Option key={i} value={i} text={String(i)}>
93 {i}-text
94 </Option>
95 ))}
96 </Select>
97 </div>
98 </div>
99 );
100 }
101}
102
103export default Controlled;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected