From b1d948476620cdc834f6b9f48290671d42df1635 Mon Sep 17 00:00:00 2001 From: Delian Asparouhov Date: Mon, 14 Dec 2015 14:32:41 -0800 Subject: [PATCH] Allow for renderTitle to be passed through Fixes #61 --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index c0b4d1030..8dcad8f36 100644 --- a/index.js +++ b/index.js @@ -264,7 +264,7 @@ class ExRoute { } const schema = schemas ? schemas[props.schema || 'default'] || {} : {}; const {name, type, title, hideNavBar, navigationBarStyle, backButtonStyle, rightButtonStyle, rightButtonTextStyle, - onEnter, onLeave, wrapRouter, sceneConfig, renderLeftButton, + onEnter, onLeave, wrapRouter, sceneConfig, renderLeftButton, renderTitle, onRight, rightTitle, header, renderRightButton, renderBackButton, footer, component, children} = {...schema, ...props}; if (!component && !children) { throw new Error("Component class or scene instance (child) should be passed"); @@ -299,6 +299,9 @@ class ExRoute { if (renderLeftButton){ this.renderLeftButton = renderLeftButton.bind(this, this); } + if (renderTitle){ + this.renderTitle = renderTitle.bind(this, this); + } this.leaf = this.component && !(this.getType() === 'switch' || this.wrapRouter); }