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

Method constructor

examples/04 Sortable/Simple/Container.js:13–40  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

11@DragDropContext(HTML5Backend)
12export default class Container extends Component {
13 constructor(props) {
14 super(props);
15 this.moveCard = this.moveCard.bind(this);
16 this.state = {
17 cards: [{
18 id: 1,
19 text: 'Write a cool JS library',
20 }, {
21 id: 2,
22 text: 'Make it generic enough',
23 }, {
24 id: 3,
25 text: 'Write README',
26 }, {
27 id: 4,
28 text: 'Create some examples',
29 }, {
30 id: 5,
31 text: 'Spam in Twitter and IRC to promote it (note that this element is taller than the others)',
32 }, {
33 id: 6,
34 text: '???',
35 }, {
36 id: 7,
37 text: 'PROFIT',
38 }],
39 };
40 }
41
42 moveCard(dragIndex, hoverIndex) {
43 const { cards } = this.state;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected