Skip to content

Commit

Permalink
Handle playVariation prop in componentWillReceiveProps()
Browse files Browse the repository at this point in the history
  • Loading branch information
yishn committed Nov 13, 2018
1 parent 8b6b309 commit b77706a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Goban.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class Goban extends Component {
this.handleVertexMouseMove = this.handleVertexMouseMove.bind(this)
this.handleVertexMouseEnter = this.handleVertexMouseEnter.bind(this)
this.handleVertexMouseLeave = this.handleVertexMouseLeave.bind(this)

this.componentWillReceiveProps()
}

componentDidMount() {
Expand Down Expand Up @@ -55,7 +57,9 @@ class Goban extends Component {
this.setState({left, top})
}
}, 0)

}

componentWillReceiveProps(prevProps) {
if (prevProps == null || prevProps.playVariation !== this.props.playVariation) {
if (this.props.playVariation != null) {
let {sign, variation, sibling} = this.props.playVariation
Expand Down

0 comments on commit b77706a

Please sign in to comment.