Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions examples/hide-todo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 });
}

Expand Down
5 changes: 1 addition & 4 deletions examples/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <div {...restProps} style={newStyle}/>;
};

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down