Skip to content

Commit 0db0c01

Browse files
committed
support props argument in renderTabBar property
1 parent 0757ed3 commit 0db0c01

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ var App = React.createClass({
7171

7272
## Props
7373

74-
- **`renderTabBar`** _(Function:ReactComponent)_ - should return a component to use as
74+
- **`renderTabBar`** _(Function:ReactComponent)_ - accept 1 argument `props` and should return a component to use as
7575
the tab bar. The component has `goToPage`, `tabs`, `activeTab` and
7676
`ref` added to the props, and should implement `setAnimationValue` to
77-
be able to animate itself along with the tab content.
77+
be able to animate itself along with the tab content. You can manually pass the `props` to the TabBar component.
7878
- **`tabBarPosition`** _(String)_ Defaults to `"top"`.
7979
- `"bottom"` to position the tab bar below content.
8080
- `"overlayTop"` or `"overlayBottom"` for a semitransparent tab bar that overlays content. Custom tab bars must consume a style prop on their outer element to support this feature: `style={this.props.style}`.

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const ScrollableTabView = React.createClass({
8888
if (this.props.renderTabBar === false) {
8989
return null;
9090
} else if (this.props.renderTabBar) {
91-
return React.cloneElement(this.props.renderTabBar(), props);
91+
return React.cloneElement(this.props.renderTabBar(props), props);
9292
} else {
9393
return <DefaultTabBar {...props} />;
9494
}

0 commit comments

Comments
 (0)