Last active
November 19, 2018 15:21
-
-
Save alejandrosobko/8d678e98ff5cecbc51a34ff8653561e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NumbersGame extends React.Component<any, INumbersGameState>{ | |
public constructor(props: any) { | |
super(props); | |
this.onDragEnd = this.onDragEnd.bind(this); | |
this.state = {...initialData}; | |
} | |
public onDragEnd(result: any) { | |
// the item was dropped! | |
} | |
public render() { | |
const numbers = this.state.column.numberIds.map((numberId: string) => this.state.numbers[numberId]); | |
return ( | |
<NumbersGameContext onDragEnd={this.onDragEnd}> | |
<VerticalColumn column={this.state.column} items={numbers} /> | |
</NumbersGameContext> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment