Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 8f3cbb6

Browse files
committed
Fixing lint errors
1 parent f18c285 commit 8f3cbb6

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"start": "npm run build",
88
"lint": "eslint --ext .js,.jsx .",
99
"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",
1212
"build": "npm run build:umd && npm run build:lib",
1313
"build:watch": "babel -w src --out-dir lib",
1414
"build:umd": "webpack -p src/index.js dist/index.js --config webpack.config.prod.js",

src/components/field-component.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ function getFieldWrapper(props) {
302302
return null;
303303
}
304304

305-
function createFieldClass(customControlPropsMap = {}) {
305+
function createFieldClass(customControlPropsMap = {}, defaultProps = {}) {
306306
const options = {
307307
controlPropsMap: {
308308
...controlPropsMap,
@@ -364,6 +364,7 @@ function createFieldClass(customControlPropsMap = {}) {
364364
asyncValidateOn: 'blur',
365365
parser: identity,
366366
changeAction: change,
367+
...defaultProps,
367368
};
368369

369370
return connect(selector)(Field);

src/native/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { createFieldClass } from '../components/field-component';
22

3+
const View = process.env.NODE_ENV === 'test'
4+
? require('react-native').View
5+
: 'div';
6+
37
const NativeField = createFieldClass({
48
MapView: props => ({
59
onRegionChange: props.onChange,
@@ -36,6 +40,8 @@ const NativeField = createFieldClass({
3640
onValueChange: props.onChange,
3741
value: props.modelValue,
3842
}),
43+
}, {
44+
component: View,
3945
});
4046

4147
export { NativeField as Field };

test/field-component-spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint react/no-multi-comp:0 react/jsx-no-bind:0 */
22
import React, { PropTypes } from 'react';
3-
import ReactDOM from 'react-dom';
43
import { assert } from 'chai';
54
import { createStore, applyMiddleware, combineReducers } from 'redux';
65
import { Provider, connect } from 'react-redux';

0 commit comments

Comments
 (0)