File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ module.exports = React.createClass({
27
27
focus : PropTypes . bool ,
28
28
children : childrenPropType ,
29
29
forceRenderTabPanel : PropTypes . bool ,
30
+ generateIdsFn : PropTypes . func ,
30
31
} ,
31
32
32
33
childContextTypes : {
@@ -169,14 +170,15 @@ module.exports = React.createClass({
169
170
const state = this . state ;
170
171
const tabIds = this . tabIds = this . tabIds || [ ] ;
171
172
const panelIds = this . panelIds = this . panelIds || [ ] ;
173
+ const generateIdsFn = this . props . generateIdsFn ? this . props . generateIdsFn : uuid ;
172
174
let diff = this . tabIds . length - this . getTabsCount ( ) ;
173
175
174
176
// Add ids if new tabs have been added
175
177
// Don't bother removing ids, just keep them in case they are added again
176
178
// This is more efficient, and keeps the uuid counter under control
177
179
while ( diff ++ < 0 ) {
178
- tabIds . push ( uuid ( ) ) ;
179
- panelIds . push ( uuid ( ) ) ;
180
+ tabIds . push ( generateIdsFn ( ) ) ;
181
+ panelIds . push ( generateIdsFn ( ) ) ;
180
182
}
181
183
182
184
// Map children to dynamically setup refs
You can’t perform that action at this time.
0 commit comments