Guest User

Untitled

a guest
Nov 19th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. class NumbersGame extends React.Component<any, INumbersGameState>{
  2.  
  3. public constructor(props: any) {
  4. super(props);
  5. this.onDragEnd = this.onDragEnd.bind(this);
  6. this.state = {...initialData};
  7. }
  8.  
  9. public onDragEnd(result: any) {
  10. // the item was dropped!
  11. }
  12.  
  13. public render() {
  14. const numbers = this.state.column.numberIds.map((numberId: string) => this.state.numbers[numberId]);
  15.  
  16. return (
  17. <NumbersGameContext onDragEnd={this.onDragEnd}>
  18. <VerticalColumn column={this.state.column} items={numbers} />
  19. </NumbersGameContext>
  20. )
  21. }
  22. }
Add Comment
Please, Sign In to add comment