diff --git a/examples/hide-todo.js b/examples/hide-todo.js index 54cffa1..43daf1b 100644 --- a/examples/hide-todo.js +++ b/examples/hide-todo.js @@ -5,7 +5,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import ReactDOM from 'react-dom'; import Animate from 'rc-animate'; -import assign from 'object-assign'; class Todo extends React.Component { static propTypes = { @@ -55,13 +54,9 @@ class TodoList extends React.Component { handleHide = (i, item) => { const newItems = this.state.items.concat([]); newItems.forEach((n, index) => { - newItems[index] = assign({}, n, { - visible: true, - }); - }); - newItems[i] = assign({}, item, { - visible: false, + newItems[index] = { ...n, visible: true }; }); + newItems[i] = { ...item, visible: false }; this.setState({ items: newItems }); } diff --git a/examples/simple.js b/examples/simple.js index 56bb461..29e7d21 100644 --- a/examples/simple.js +++ b/examples/simple.js @@ -5,13 +5,10 @@ import Animate from 'rc-animate'; import React, { Component } from 'react'; import PropTypes from 'prop-types'; import ReactDOM from 'react-dom'; -import assign from 'object-assign'; const Div = (props) => { const { style, show, ...restProps } = props; - const newStyle = assign({}, style, { - display: show ? '' : 'none', - }); + const newStyle = { ...style, display: show ? '' : 'none' }; return
; }; diff --git a/package.json b/package.json index 03713a6..30917f4 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,6 @@ "core-js": "^2.5.1", "expect.js": "0.3.x", "jquery": "~1.11.3", - "object-assign": "4.x", "pre-commit": "1.x", "rc-test": "6.x", "rc-tools": "6.x",