@@ -2,28 +2,28 @@ import React from 'react';
2
2
import PropTypes from 'prop-types' ;
3
3
4
4
function SelectWidget ( props ) {
5
- const { view, value, onChange } = props ;
6
- const choices = view . choices . map ( c => (
7
- < option key = { c . value } value = { c . value } >
8
- { c . label }
9
- </ option >
10
- ) ) ;
11
- return (
12
- < select value = { value } onChange = { e => onChange ( e . target . value ) } >
13
- { choices }
14
- </ select >
15
- ) ;
5
+ const { view, value, onChange } = props ;
6
+ const choices = view . choices . map ( c => (
7
+ < option key = { c . value } value = { c . value } >
8
+ { c . label }
9
+ </ option >
10
+ ) ) ;
11
+ return (
12
+ < select value = { value } onChange = { e => onChange ( e . target . value ) } >
13
+ { choices }
14
+ </ select >
15
+ ) ;
16
16
}
17
17
SelectWidget . propTypes = {
18
- view : PropTypes . shape ( {
19
- choices : PropTypes . arrayOf (
20
- PropTypes . shape ( {
21
- value : PropTypes . any ,
22
- label : PropTypes . string . isRequired
23
- } )
24
- ) . isRequired
25
- } ) . isRequired ,
26
- value : PropTypes . any , // eslint-disable-line
27
- onChange : PropTypes . func . isRequired
18
+ view : PropTypes . shape ( {
19
+ choices : PropTypes . arrayOf (
20
+ PropTypes . shape ( {
21
+ value : PropTypes . any ,
22
+ label : PropTypes . string . isRequired ,
23
+ } ) ,
24
+ ) . isRequired ,
25
+ } ) . isRequired ,
26
+ value : PropTypes . any , // eslint-disable-line
27
+ onChange : PropTypes . func . isRequired ,
28
28
} ;
29
29
export default SelectWidget ;
0 commit comments