File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 24
24
- [ SideNavigation Component with State Handle] ( react-js/SideNavigation )
25
25
- [ Team Component] ( react-js/team/Team.js )
26
26
- [ Array Interval Delay and Hide Previous Element] ( react-js/array-plus-delay.js )
27
+ - [ React Select Option] ( react-js/SelectOption.js )
27
28
- [ Not Found Page] ( react-js/NotFound.js )
28
29
29
30
## Python
Original file line number Diff line number Diff line change
1
+ import React , { Component } from 'react'
2
+
3
+ export default class SelectOption extends Component {
4
+ state = {
5
+ type : ""
6
+ }
7
+ render ( ) {
8
+ return (
9
+ < div >
10
+ < select name = "name" onChange = { ( e ) => this . setState ( { type : e . target . value } ) }
11
+ className = "form-control" >
12
+ < option disabled selected value > Select an option </ option >
13
+ < option value = "buy" selected = { type === "buy" ? true : "" } > Buy</ option > { /* selected option */ }
14
+ < option value = "sell" selected = { type === "sell" ? true : "" } > Sell</ option >
15
+ </ select >
16
+ </ div >
17
+ )
18
+ }
19
+ }
You can’t perform that action at this time.
0 commit comments