Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 1019 Bytes

README.md

File metadata and controls

39 lines (32 loc) · 1019 Bytes

React Drag And Drop to IFrame

Based on the Single Target react-dnd demo.

Uses a patched version of react-dnd-html5-backend and a custom Frame component which passes the dragDropManager instance to the DropTarget that lives in the iframe.

@DragDropContext(HTML5Backend)
export default class App extends Component {
  render() {
    return (
      <div>
        <div style={{ overflow: 'hidden', clear: 'both' }}>
          <Frame>
            <Dustbin />
          </Frame>
        </div>
        <div style={{ overflow: 'hidden', clear: 'both' }}>
          <Box name='Glass' />
          <Box name='Banana' />
          <Box name='Paper' />
        </div>
      </div>
    );
  }
}
npm install
npm start
open http://localhost:3000

License

CC0 (public domain)