components/drag-target
v0.0.1
0.0.1
Collaborators
Gravatar for undefined
6
MIT
PUBLIC
0
4     DEPENDENCIES
BuildPass

Accept dragged content from the browser or the desktop.

Use components/drag-target in your project
npm i @bit/khan.react-components.components.drag-target

dragTarget ()

Accept dragged content from the browser or the desktop.

Example

var Target = React.createClass({
    render: function() {
        return <DragTarget onDrop={this.handleDrop}>
            {this.state.message}
        </DragTarget>;
    },
    handleDrop: function(event) {
        this.setState({ message: "delicious. thank you!" });
    },
    getInitialState: function() {
        return { message: "I haven't received any drags" };
    }
});
return <Target />;
NameTypeDescription
onDropPropTypes.func
componentPropTypes.any
shouldDragHighlightPropTypes.func
stylePropTypes.any

Test Summary


DragTarget shows hover at the appropriate timesPass
DragTarget accepts dropsPass