Created
December 7, 2018 22:48
-
-
Save bryceosterhaus/b374109aa10d0c90c7573e37d9585702 to your computer and use it in GitHub Desktop.
This file contains 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
Row { | |
handleMoveDown() { | |
this.props.onChange(this.props.index, -1); | |
} | |
handleMoveUp() { | |
this.props.onChange(this.props.index, 1); | |
} | |
} | |
Group { | |
handleReorder(index, numOfRows) { | |
const newRowOrder = [...this.state.rows]; | |
// Manipulate newRowOrder here to move it +/- rows | |
return newRowOrder | |
} | |
render() { | |
return <div> | |
{this.state.rows.map((item, i) => <Row index={i} onChange={this.handleReorder} />)} | |
</div> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment