1
1
import React , { Component , PropTypes } from 'react' ;
2
2
import FormGroup from '../FormGroup' ;
3
- import ReSelect from 'react-select' ;
3
+ import Select from 'react-select' ;
4
4
5
5
class Lookup extends Component {
6
6
fetchItems = ( ) => {
@@ -20,15 +20,22 @@ class Lookup extends Component {
20
20
21
21
if ( ! options . url && Array . isArray ( options ) ) {
22
22
selectProps = { options, value, name, onChange, onBlur : ( event ) => onBlur ( ) } ;
23
+
24
+ return (
25
+ < FormGroup { ...formGroupProps } >
26
+ < Select { ...selectProps } />
27
+ </ FormGroup >
28
+ )
29
+
23
30
} else {
24
- selectProps = { value, name, onChange, onBlur : ( event ) => onBlur ( ) , loadOptions : this . fetchItems , valueKey : options . value ? options . value : 'value' , labelKey : options . label ? options . label : 'label' }
25
- }
31
+ selectProps = { value, name, onChange, onBlur : ( event ) => onBlur ( ) , loadOptions : this . fetchItems , valueKey : options . value ? options . value : 'value' , labelKey : options . label ? options . label : 'label' } ;
26
32
27
- return (
28
- < FormGroup { ...formGroupProps } >
29
- < ReSelect . Async { ...selectProps } />
30
- </ FormGroup >
31
- )
33
+ return (
34
+ < FormGroup { ...formGroupProps } >
35
+ < Select . Async { ...selectProps } />
36
+ </ FormGroup >
37
+ )
38
+ }
32
39
}
33
40
}
34
41
0 commit comments