Description
Version
Tell us which versions you are using:
- react-native-router-flux: 3.36.0,
- react-native v0.34.1
Expected behaviour
Rendering priority:
-Left Button
-Back Button
Actual behaviour
Rendering priority:
-Back Button
-Left Button
Steps to reproduce
- Create scene1 and scene2
- From scene1 create a button to redirect to scene2 (stack = [scene1, scene2])
In scene2:
- Set hideBackImage = true, renderBackButton = null
- Set leftButtonImage = an image, onLeft = a function
In scene2, leftButton was not rendered. Maybe it was caused by:
-renderBackButton in scene2 always return not null component (because scene2 is child of scene1)
renderBackButton return null if and only if the scene is a root
if (state.index === 0 && (!state.parentIndex || state.parentIndex === 0)) { return null; }
-rendering priority
Here is source code to render NavBar
<View> {renderTitle ? renderTitle(navProps) : state.children.map(this.renderTitle, this)} {renderBackButton(navProps) || renderLeftButton(navProps)} {renderRightButton(navProps)} </View>
renderLeftButton in scene2 was never rendered, because, it's priority is lower than renderBackButton