Skip to content

Commit

Permalink
[changed] Remove Dev dependency babel-plugin-object-assign.
Browse files Browse the repository at this point in the history
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
});
```
  • Loading branch information
AlexKVal committed Jun 1, 2015
1 parent 1449472 commit 29bc64f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"optional": [
"es7.objectRestSpread"
],
"plugins": [
"object-assign"
]
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"babel-core": "^5.1.10",
"babel-eslint": "^3.0.1",
"babel-loader": "^5.0.0",
"babel-plugin-object-assign": "^1.1.0",
"bootstrap": "^3.3.4",
"brfs": "^1.4.0",
"chai": "^2.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Interpolate.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Interpolate = React.createClass({
this.props.children : this.props.format;
let parent = this.props.component;
let unsafe = this.props.unsafe === true;
let props = Object.assign({}, this.props);
let props = {...this.props};

delete props.children;
delete props.format;
Expand Down
5 changes: 3 additions & 2 deletions src/OverlayTrigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,11 @@ const OverlayTrigger = React.createClass({
const offset = container.tagName === 'BODY' ?
domUtils.getOffset(node) : domUtils.getPosition(node, container);

return Object.assign({}, offset, {
return {
...offset, // eslint-disable-line object-shorthand
height: node.offsetHeight,
width: node.offsetWidth
});
};
}
});

Expand Down

0 comments on commit 29bc64f

Please sign in to comment.