File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ var NavBarContainer = React.createClass({
6868 goForward = { this . goForward }
6969 leftProps = { this . props . leftProps }
7070 rightProps = { this . props . rightProps }
71+ titleProps = { this . props . titleProps }
7172 customAction = { this . customAction }
7273 />
7374 </ View > )
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ var NavBarContent = React.createClass({
104104
105105 if ( this . props . route . titleComponent ) {
106106 var TitleComponent = this . props . route . titleComponent ;
107- titleContent = < TitleComponent /> ;
107+ titleContent = < TitleComponent { ... this . props . titleProps } /> ;
108108 } else {
109109 titleContent = (
110110 < Text style = { [ styles . navbarText , this . props . titleStyle ] } numberOfLines = { 1 } >
Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ var Router = React.createClass({
5959 this . setState ( { leftProps : props } ) ;
6060 } ,
6161
62+ setTitleProps : function ( props ) {
63+ this . setState ( { titleProps : props } ) ;
64+ } ,
65+
6266 customAction : function ( opts ) {
6367 this . props . customAction ( opts ) ;
6468 } ,
@@ -91,6 +95,10 @@ var Router = React.createClass({
9195 this . setState ( { leftProps : props } ) ;
9296 } . bind ( this ) ;
9397
98+ var setTitleProps = function ( props ) {
99+ this . setState ( { titleProps : props } ) ;
100+ } . bind ( this ) ;
101+
94102 var customAction = function ( opts ) {
95103 this . customAction ( opts ) ;
96104 } . bind ( this ) ;
@@ -151,6 +159,7 @@ var Router = React.createClass({
151159 reset = { goToFirstRoute }
152160 setRightProps = { setRightProps }
153161 setLeftProps = { setLeftProps }
162+ setTitleProps = { setTitleProps }
154163 customAction = { customAction }
155164 { ...route . passProps }
156165 />
@@ -189,6 +198,7 @@ var Router = React.createClass({
189198 toBack = { this . onBack }
190199 leftProps = { this . state . leftProps }
191200 rightProps = { this . state . rightProps }
201+ titleProps = { this . state . titleProps }
192202 customAction = { this . customAction }
193203 />
194204 }
You can’t perform that action at this time.
0 commit comments