MCPcopy Create free account
hub / github.com/react-dnd/react-dnd / constructor

Method constructor

examples/04 Sortable/Stress Test/Container.js:14–33  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

12@DragDropContext(HTML5Backend)
13export default class Container extends Component {
14 constructor(props) {
15 super(props);
16
17 this.moveCard = this.moveCard.bind(this);
18 this.drawFrame = this.drawFrame.bind(this);
19
20 const cardsById = {};
21 const cardsByIndex = [];
22
23 for (let i = 0; i < 1000; i += 1) {
24 const card = { id: i, text: name.findName() };
25 cardsById[card.id] = card;
26 cardsByIndex[i] = card;
27 }
28
29 this.state = {
30 cardsById,
31 cardsByIndex,
32 };
33 }
34
35 moveCard(id, afterId) {
36 const { cardsById, cardsByIndex } = this.state;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected