Skip to content

Commit

Permalink
[Tabs] Fix issue mui#4633, an edge case where children (rendered Tab …
Browse files Browse the repository at this point in the history
…elements) and value props change.
  • Loading branch information
mike-robertson committed Jul 6, 2016
1 parent ed9f346 commit cac0a43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ class Tabs extends Component {
);
}

getTabs() {
getTabs(props = this.props) {
const tabs = [];
React.Children.forEach(this.props.children, (tab) => {
React.Children.forEach(props.children, (tab) => {
if (React.isValidElement(tab)) {
tabs.push(tab);
}
Expand All @@ -138,7 +138,7 @@ class Tabs extends Component {
const valueLink = this.getValueLink(props);
let selectedIndex = -1;

this.getTabs().forEach((tab, index) => {
this.getTabs(props).forEach((tab, index) => {
if (valueLink.value === tab.props.value) {
selectedIndex = index;
}
Expand Down

0 comments on commit cac0a43

Please sign in to comment.