Skip to content

Commit 29bc64f

Browse files
committedJun 1, 2015
[changed] Remove Dev dependency babel-plugin-object-assign.
Instead of `let props = Object.assign({}, this.props);` use `let props = {...this.props};` which is transpiled into `var props = _extends({}, this.props);` Instead of ```js return Object.assign({}, offset, { height: node.offsetHeight, width: node.offsetWidth }); ``` use ```js // ES6 return { ...offset, height: node.offsetHeight, width: node.offsetWidth }; ``` which is transpiled into ```js // ES5 return _extends({}, offset, { height: node.offsetHeight, width: node.offsetWidth }); ```
1 parent 1449472 commit 29bc64f

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed
 

‎.babelrc

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
22
"optional": [
33
"es7.objectRestSpread"
4-
],
5-
"plugins": [
6-
"object-assign"
74
]
85
}

‎package.json

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"babel-core": "^5.1.10",
4545
"babel-eslint": "^3.0.1",
4646
"babel-loader": "^5.0.0",
47-
"babel-plugin-object-assign": "^1.1.0",
4847
"bootstrap": "^3.3.4",
4948
"brfs": "^1.4.0",
5049
"chai": "^2.2.0",

‎src/Interpolate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const Interpolate = React.createClass({
2323
this.props.children : this.props.format;
2424
let parent = this.props.component;
2525
let unsafe = this.props.unsafe === true;
26-
let props = Object.assign({}, this.props);
26+
let props = {...this.props};
2727

2828
delete props.children;
2929
delete props.format;

‎src/OverlayTrigger.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,11 @@ const OverlayTrigger = React.createClass({
304304
const offset = container.tagName === 'BODY' ?
305305
domUtils.getOffset(node) : domUtils.getPosition(node, container);
306306

307-
return Object.assign({}, offset, {
307+
return {
308+
...offset, // eslint-disable-line object-shorthand
308309
height: node.offsetHeight,
309310
width: node.offsetWidth
310-
});
311+
};
311312
}
312313
});
313314

0 commit comments

Comments
 (0)
Please sign in to comment.