Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Could not find the drag and drop manager in the context of ResourceEvents. Make sure to wrap the top-level component of your app with DragDropContext app.js

import React, { Component } from "react";
// import ReactDOM from "react-dom";
import HTML5Backend from "react-dnd-html5-backend";
import { DragDropContext as dragDropContext } from "react-dnd";
import DragBox from "./DragBox";
import DropBox from "./DropBox";

class MainContext extends Component {
  render() {
    return (
      <div style={{ borderStyle: "solid" }}>
        <p style={{ padding: "0px 10px" }}>Main Context</p>
        <DragBox />
        <DropBox />
      </div>
    );
  }
}

module.exports = dragDropContext(HTML5Backend)(MainContext);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Could #find #drag #drop #manager #context #Make #wrap #component #app #DragDropContext
ADD COMMENT
Topic
Name
9+7 =