From 0db0c010bd431bfad1af9ba458ca7ac19fa4894f Mon Sep 17 00:00:00 2001 From: kiliwalk Date: Wed, 25 May 2016 16:06:38 +0800 Subject: [PATCH] support props argument in renderTabBar property --- README.md | 4 ++-- index.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aa596030..000f953e 100644 --- a/README.md +++ b/README.md @@ -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}`. diff --git a/index.js b/index.js index 77a13486..7b89840a 100644 --- a/index.js +++ b/index.js @@ -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 ; }