File tree Expand file tree Collapse file tree 1 file changed +19
-20
lines changed Expand file tree Collapse file tree 1 file changed +19
-20
lines changed Original file line number Diff line number Diff line change 1
- import React , { PropTypes } from 'react' ;
1
+ import React , { PropTypes , Component } from 'react' ;
2
2
import { findDOMNode } from 'react-dom' ;
3
3
import cx from 'classnames' ;
4
4
5
- module . exports = React . createClass ( {
6
- displayName : 'Tab' ,
5
+ class Tab extends Component {
7
6
8
- propTypes : {
7
+ static propTypes = {
9
8
className : PropTypes . string ,
10
9
id : PropTypes . string ,
11
10
focus : PropTypes . bool ,
@@ -19,32 +18,30 @@ module.exports = React.createClass({
19
18
PropTypes . object ,
20
19
PropTypes . string ,
21
20
] ) ,
22
- } ,
21
+ } ;
23
22
24
- getDefaultProps ( ) {
25
- return {
26
- focus : false ,
27
- selected : false ,
28
- id : null ,
29
- panelId : null ,
30
- activeTabClassName : 'ReactTabs__Tab--selected' ,
31
- disabledTabClassName : 'ReactTabs__Tab--disabled' ,
32
- } ;
33
- } ,
23
+ static defaultProps = {
24
+ focus : false ,
25
+ selected : false ,
26
+ id : null ,
27
+ panelId : null ,
28
+ activeTabClassName : 'ReactTabs__Tab--selected' ,
29
+ disabledTabClassName : 'ReactTabs__Tab--disabled' ,
30
+ } ;
34
31
35
32
componentDidMount ( ) {
36
33
this . checkFocus ( ) ;
37
- } ,
34
+ }
38
35
39
36
componentDidUpdate ( ) {
40
37
this . checkFocus ( ) ;
41
- } ,
38
+ }
42
39
43
40
checkFocus ( ) {
44
41
if ( this . props . selected && this . props . focus ) {
45
42
findDOMNode ( this ) . focus ( ) ;
46
43
}
47
- } ,
44
+ }
48
45
49
46
render ( ) {
50
47
const {
@@ -81,5 +78,7 @@ module.exports = React.createClass({
81
78
{ children }
82
79
</ li >
83
80
) ;
84
- } ,
85
- } ) ;
81
+ }
82
+ }
83
+
84
+ export default Tab ;
You can’t perform that action at this time.
0 commit comments