Share your code. Components are building blocks, you are the architect.

components/drag-target
v0.0.1
0.0.1
MIT
PUBLIC
0
4     DEPENDENCIES
Build: pass
BuildPass
Build Status: pass
Accept dragged content from the browser or the desktop.
Gravatar for undefined
khan
Contributors
Gravatar for undefined
6

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use components/drag-target in your project
npm i @bit/khan.react-components.components.drag-target
Copied

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