Skip to content

Commit ad1cfa1

Browse files
committed
Allow forceRender directly on TabPanel
1 parent 4873ddd commit ad1cfa1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/components/TabPanel.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ export default class TabPanel extends Component {
77
static defaultProps = {
88
activeClassName: 'ReactTabs__TabPanel--selected',
99
className: 'ReactTabs__TabPanel',
10+
forceRender: false,
1011
style: {},
1112
};
1213

1314
static propTypes = {
1415
activeClassName: PropTypes.string, // private
1516
children: PropTypes.node,
1617
className: PropTypes.oneOfType([PropTypes.string, PropTypes.array, PropTypes.object]),
17-
forceRenderTabPanel: PropTypes.bool, // private
18+
forceRender: PropTypes.bool,
1819
id: PropTypes.string, // private
1920
selected: PropTypes.bool, // private
2021
style: PropTypes.object,
@@ -26,7 +27,7 @@ export default class TabPanel extends Component {
2627
activeClassName,
2728
children,
2829
className,
29-
forceRenderTabPanel,
30+
forceRender,
3031
id,
3132
selected,
3233
style,
@@ -46,7 +47,7 @@ export default class TabPanel extends Component {
4647
id={id}
4748
aria-labelledby={tabId}
4849
>
49-
{(forceRenderTabPanel || selected) ? children : null}
50+
{(forceRender || selected) ? children : null}
5051
</div>
5152
);
5253
}

src/components/UncontrolledTabs.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export default class UncontrolledTabs extends Component {
2323
static defaultProps = {
2424
className: 'ReactTabs',
2525
focus: false,
26-
forceRenderTabPanel: false,
2726
};
2827

2928
static propTypes = {
@@ -172,7 +171,7 @@ export default class UncontrolledTabs extends Component {
172171
const id = this.panelIds[index];
173172
const tabId = this.tabIds[index];
174173
const selected = this.props.selectedIndex === index;
175-
const forceRenderTabPanel = this.props.forceRenderTabPanel;
174+
const forceRender = this.props.forceRenderTabPanel;
176175
const activeClassName = this.props.activeTabPanelClassName;
177176

178177
index++;
@@ -181,7 +180,7 @@ export default class UncontrolledTabs extends Component {
181180
id,
182181
tabId,
183182
selected,
184-
forceRenderTabPanel,
183+
forceRender,
185184
activeClassName,
186185
});
187186
}

0 commit comments

Comments
 (0)