@@ -5,15 +5,16 @@ module.exports = React.createClass({
5
5
displayName : 'TabPanel' ,
6
6
7
7
propTypes : {
8
- className : PropTypes . string ,
9
- selected : PropTypes . bool ,
10
- id : PropTypes . string ,
11
- tabId : PropTypes . string ,
12
8
children : PropTypes . oneOfType ( [
13
9
PropTypes . array ,
14
10
PropTypes . object ,
15
11
PropTypes . string ,
16
12
] ) ,
13
+ className : PropTypes . string ,
14
+ id : PropTypes . string ,
15
+ selected : PropTypes . bool ,
16
+ style : PropTypes . object ,
17
+ tabId : PropTypes . string ,
17
18
} ,
18
19
19
20
contextTypes : {
@@ -29,11 +30,7 @@ module.exports = React.createClass({
29
30
} ,
30
31
31
32
render ( ) {
32
- const { className, children, selected, id, tabId, ...attributes } = this . props ;
33
-
34
- // Merge style
35
- let style = { ...attributes . style , display : selected ? null : 'none' } ;
36
- delete attributes . style ;
33
+ const { className, children, selected, id, tabId, style, ...attributes } = this . props ;
37
34
38
35
return (
39
36
< div
@@ -48,7 +45,7 @@ module.exports = React.createClass({
48
45
role = "tabpanel"
49
46
id = { id }
50
47
aria-labelledby = { tabId }
51
- style = { style }
48
+ style = { { ... style , display : selected ? null : 'none' } }
52
49
>
53
50
{ ( this . context . forceRenderTabPanel || selected ) ? children : null }
54
51
</ div >
0 commit comments