This repository was archived by the owner on Aug 23, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 7
7
"start" : " npm run build" ,
8
8
"lint" : " eslint --ext .js,.jsx ." ,
9
9
"lint:fix" : " eslint --fix --ext .js,.jsx ." ,
10
- "test" : " mocha --require babel-register --require ./test/spec-setup.js" ,
11
- "test:watch" : " mocha -w --require babel-register --require ./test/spec-setup.js" ,
10
+ "test" : " NODE_ENV=test mocha --require babel-register --require ./test/spec-setup.js" ,
11
+ "test:watch" : " NODE_ENV=test mocha -w --require babel-register --require ./test/spec-setup.js" ,
12
12
"build" : " npm run build:umd && npm run build:lib" ,
13
13
"build:watch" : " babel -w src --out-dir lib" ,
14
14
"build:umd" : " webpack -p src/index.js dist/index.js --config webpack.config.prod.js" ,
Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ function getFieldWrapper(props) {
302
302
return null ;
303
303
}
304
304
305
- function createFieldClass ( customControlPropsMap = { } ) {
305
+ function createFieldClass ( customControlPropsMap = { } , defaultProps = { } ) {
306
306
const options = {
307
307
controlPropsMap : {
308
308
...controlPropsMap ,
@@ -364,6 +364,7 @@ function createFieldClass(customControlPropsMap = {}) {
364
364
asyncValidateOn : 'blur' ,
365
365
parser : identity ,
366
366
changeAction : change ,
367
+ ...defaultProps ,
367
368
} ;
368
369
369
370
return connect ( selector ) ( Field ) ;
Original file line number Diff line number Diff line change 1
1
import { createFieldClass } from '../components/field-component' ;
2
2
3
+ const View = process . env . NODE_ENV === 'test'
4
+ ? require ( 'react-native' ) . View
5
+ : 'div' ;
6
+
3
7
const NativeField = createFieldClass ( {
4
8
MapView : props => ( {
5
9
onRegionChange : props . onChange ,
@@ -36,6 +40,8 @@ const NativeField = createFieldClass({
36
40
onValueChange : props . onChange ,
37
41
value : props . modelValue ,
38
42
} ) ,
43
+ } , {
44
+ component : View ,
39
45
} ) ;
40
46
41
47
export { NativeField as Field } ;
Original file line number Diff line number Diff line change 1
1
/* eslint react/no-multi-comp:0 react/jsx-no-bind:0 */
2
2
import React , { PropTypes } from 'react' ;
3
- import ReactDOM from 'react-dom' ;
4
3
import { assert } from 'chai' ;
5
4
import { createStore , applyMiddleware , combineReducers } from 'redux' ;
6
5
import { Provider , connect } from 'react-redux' ;
You can’t perform that action at this time.
0 commit comments