diff --git a/package.json b/package.json
index 570be8f..c81eea4 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"babel-preset-react": "6.3.13",
"coveralls": "2.11.6",
"eslint": "1.10.3",
- "eslint-config-airbnb": "2.1.1",
+ "eslint-config-airbnb": "3.0.0",
"eslint-plugin-react": "3.14.0",
"istanbul": "0.4.1",
"mocha": "2.3.4",
diff --git a/src/index.js b/src/index.js
index 5103dc1..091995b 100644
--- a/src/index.js
+++ b/src/index.js
@@ -57,14 +57,15 @@ const flavourComponent = stampit()
/* eslint-disable no-use-before-define */
const reduceChildren =
function (parentComponent, reactClass, parentIndx, childMap, child, indx) {
+ const thisMap = _.assign({}, childMap);
const childIsElement = TestUtils.isElement(child);
const id = parseInt(parentIndx, 10) >= 0 ? parentIndx + '.' + indx : indx;
if (childIsElement) {
- childMap[id] = flavourComponent(_.assign({}, child, { parentComponent, reactClass }));
+ thisMap[id] = flavourComponent(_.assign({}, child, { parentComponent, reactClass }));
_.assign(
- childMap,
+ thisMap,
convertAndReduce(
parentComponent,
reactClass,
@@ -73,12 +74,12 @@ const reduceChildren =
)
);
} else {
- childMap[id] = {
+ thisMap[id] = {
value: child,
};
}
- return childMap;
+ return thisMap;
};
/* eslint-enable no-use-before-define */
@@ -114,7 +115,11 @@ const flavourInit = function (opts) {
}
this.type = output.type;
- this.childMap = convertAndReduce(this.component, opts.instance.reactClass, output.props.children);
+ this.childMap = convertAndReduce(
+ this.component,
+ opts.instance.reactClass,
+ output.props.children
+ );
} else {
this.type = output;
this.childMap = [];
diff --git a/tests/components/stamp/stamp-smart.js b/tests/components/stamp/stamp-smart.js
index 3118b42..a807192 100644
--- a/tests/components/stamp/stamp-smart.js
+++ b/tests/components/stamp/stamp-smart.js
@@ -11,6 +11,8 @@ export default class StampSmartComponent extends Component {
this.state = props.state || {
type: stampTypes.NONE,
};
+
+ this.handleOnClick = this.handleOnClick.bind(this);
}
getNextStampType(types, currentType) {
@@ -44,7 +46,7 @@ export default class StampSmartComponent extends Component {
);
}
diff --git a/tests/index.js b/tests/index.js
index 00c677d..603f329 100644
--- a/tests/index.js
+++ b/tests/index.js
@@ -3,11 +3,16 @@ import ReactDOM from 'react-dom';
import App from './components/app/app';
const comingFrom = 'Welcome from some sort of React holiday';
-const message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec commodo venenatis tortor, ' +
- 'in viverra libero ullamcorper quis. Nam blandit volutpat ante sit amet sagittis. Cras ultrices augue sem, ' +
- 'id congue felis efficitur a. Mauris luctus, nisl eu dignissim molestie, sem libero fringilla ex, ' +
- 'id faucibus ligula justo et nibh. Donec posuere rhoncus leo eget fringilla. Nulla ex arcu, ' +
- 'gravida nec malesuada sit amet, faucibus ut lectus. Donec elementum sapien a lorem tristique egestas. ' +
+const message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ' +
+ 'Donec commodo venenatis tortor, ' +
+ 'in viverra libero ullamcorper quis. Nam blandit volutpat ante sit amet sagittis. ' +
+ 'Cras ultrices augue sem, ' +
+ 'id congue felis efficitur a. Mauris luctus, nisl eu dignissim molestie, ' +
+ 'sem libero fringilla ex, ' +
+ 'id faucibus ligula justo et nibh. Donec posuere rhoncus leo eget fringilla. ' +
+ 'Nulla ex arcu, ' +
+ 'gravida nec malesuada sit amet, faucibus ut lectus. ' +
+ 'Donec elementum sapien a lorem tristique egestas. ' +
'Etiam a orci tincidunt, interdum leo blandit, consequat risus.';
const signature = 'John Smith';
const addressee = 'Mrs. Joanne Bloggs';
diff --git a/tests/stand-alone/link-list/link-list.js b/tests/stand-alone/link-list/link-list.js
index 2176396..8ab89c3 100644
--- a/tests/stand-alone/link-list/link-list.js
+++ b/tests/stand-alone/link-list/link-list.js
@@ -4,6 +4,10 @@ import Link from './link';
export default class LinkListComponent extends Component {
constructor(props) {
super(props);
+
+ this.handleLink1Click = this.handleLink1Click.bind(this);
+ this.handleLink2Click = this.handleLink2Click.bind(this);
+ this.handleLink3Click = this.handleLink3Click.bind(this);
}
handleLink1Click() {
@@ -22,13 +26,13 @@ export default class LinkListComponent extends Component {
const { links } = this.props;
return (
diff --git a/tests/stand-alone/unordered-list/unordered-list.js b/tests/stand-alone/unordered-list/unordered-list.js
index 1e55793..d1b0393 100644
--- a/tests/stand-alone/unordered-list/unordered-list.js
+++ b/tests/stand-alone/unordered-list/unordered-list.js
@@ -36,13 +36,21 @@ export default class UnorderedListComponent extends Component {
}
render() {
- const { i18n = {}, links = [], rlinks = [], drlinkssrc = [], randomString = '', email = '' } = this.props;
+ const {
+ i18n = {},
+ links = [],
+ rlinks = [],
+ drlinkssrc = [],
+ randomString = '',
+ email = '',
+ } = this.props;
const drlinks = email ? this.getDrlinks(i18n, email, drlinkssrc, randomString) : [];
return (