Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
support props argument in renderTabBar property
  • Loading branch information
kilihorse committed May 25, 2016
commit 0db0c010bd431bfad1af9ba458ca7ac19fa4894f
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ var App = React.createClass({

## Props

- **`renderTabBar`** _(Function:ReactComponent)_ - should return a component to use as
- **`renderTabBar`** _(Function:ReactComponent)_ - accept 1 argument `props` and should return a component to use as
the tab bar. The component has `goToPage`, `tabs`, `activeTab` and
`ref` added to the props, and should implement `setAnimationValue` to
be able to animate itself along with the tab content.
be able to animate itself along with the tab content. You can manually pass the `props` to the TabBar component.
- **`tabBarPosition`** _(String)_ Defaults to `"top"`.
- `"bottom"` to position the tab bar below content.
- `"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}`.
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const ScrollableTabView = React.createClass({
if (this.props.renderTabBar === false) {
return null;
} else if (this.props.renderTabBar) {
return React.cloneElement(this.props.renderTabBar(), props);
return React.cloneElement(this.props.renderTabBar(props), props);
} else {
return <DefaultTabBar {...props} />;
}
Expand Down