Skip to content

Commit ae3f12b

Browse files
authored
Merge pull request microsoft#1379 from microsoft/fix-stack-overflow
Fix stack overflow in board configuration view
2 parents c3ff82a + df3c26e commit ae3f12b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/views/app/components/BoardSelector.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ export default class BoardSelector extends React.Component<IBoardSelectorProps,
2323
this.updateSelectedBoard = this.updateSelectedBoard.bind(this);
2424
}
2525

26-
public render() {
27-
if (!this.state.selectedBoard && this.props.installedBoards.length) {
26+
public componentWillReceiveProps(nextProps) {
27+
if (!this.state.selectedBoard && nextProps.installedBoards.length) {
2828
this.setState({
29-
selectedBoard: this.props.installedBoards.find((bd) => bd.isSelected),
29+
selectedBoard: nextProps.installedBoards.find((bd) => bd.isSelected),
3030
});
3131
}
32+
}
33+
34+
public render() {
3235
const options = this.props.installedBoards.map((b) => {
3336
return {
3437
value: b.key,

0 commit comments

Comments
 (0)