Skip to content
This repository was archived by the owner on May 15, 2019. It is now read-only.

Commit fee9ceb

Browse files
committed
Fix react warning in react-components
Summary: This fixes a recent react warning that would show up every time you opened a Perseus editor locally. 😱 I'm not sure whether we're allowed to use object rest spread syntax in this repo, so I'm just using normal ES6 stuff. Test Plan: - Visit http://localhost:9000/?article#content=%5B%7B%22content%22%3A%22Here%27s%20the%20type%20of%20problem%20you%20might%20see%20on%20the%20AP%20Statistics%20exam%20where%20you%20have%20to%20use%20the%20sampling%20distribution%20of%20a%20sample%20proportion.%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%7D%7D%5D - See no react warning! Reviewers: john, joshuan Reviewed By: john Subscribers: tom Differential Revision: https://phabricator.khanacademy.org/D40017
1 parent 50f5b33 commit fee9ceb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/drag-target.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ const DragTarget = React.createClass({
6464
const opacity = this.state.dragHover ? {"opacity": 0.3} : {};
6565
const Component = this.props.component;
6666

67+
const forwardProps = Object.assign({}, this.props);
68+
delete forwardProps.component;
69+
delete forwardProps.shouldDragHighlight;
70+
6771
return (
6872
<Component
69-
{...this.props}
73+
{...forwardProps}
7074
style={Object.assign({}, this.props.style, opacity)}
7175
onDrop={this.handleDrop}
7276
onDragEnd={this.handleDragEnd}

0 commit comments

Comments
 (0)