This repository was archived by the owner on Oct 19, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,9 +115,10 @@ export default class Tabs extends React.Component {
115115 return React . Children . map ( this . props . children , tab => tab ) ;
116116 }
117117
118- getTabAt = index => {
118+ getTabAt = ( index , useFresh ) => {
119119 return (
120- this [ `tab${ index } ` ] || React . Children . toArray ( this . props . children ) [ index ]
120+ ( ! useFresh && this [ `tab${ index } ` ] ) ||
121+ React . Children . toArray ( this . props . children ) [ index ]
121122 ) ;
122123 } ;
123124
@@ -251,7 +252,7 @@ export default class Tabs extends React.Component {
251252 } ) ,
252253 } ;
253254
254- const selectedTab = this . getTabAt ( this . state . selected ) ;
255+ const selectedTab = this . getTabAt ( this . state . selected , true ) ;
255256 const selectedLabel = selectedTab ? selectedTab . props . label : '' ;
256257
257258 return (
You can’t perform that action at this time.
0 commit comments