React-native-router-flux: renderNavigationBar

Created on 18 Mar 2016  路  8Comments  路  Source: aksonov/react-native-router-flux

Hi~How to use renderNavigationBar(props) method? I implement it in my class,but it does not work. Can you give a example for it? thank you.

Most helpful comment

In my case, the navBar is rendered at the bottom of the page, rather than the top. tried removing all styles from the top/wrapping view of my component, without luck.

Also, I was trying to pass down my redux states, but it seems it isn't part of the props passed to the static method :/

All 8 comments

I found

childrenState.component.renderNavigationBar

is undefine

in NavBar.js

Have you provided static renderNavigationBar method for your component? Then it cannot be undefined...

class Login extends React.Component {
renderNavigationBar(props){
return
}

render(){
    return (
        <View style={[styles.container, this.props.style]}>
            <Text>Login page: {this.props.data}</Text>
            <Button onPress={Actions.loginModal}>Login 2</Button>
            <Button onPress={Actions.pop}>Back</Button>
        </View>
    );
}

}

Here is my demo code, it's not work for renderNavigationBar.

Ugh, method is not static....

I see~ thank you very much.

In my case, the navBar is rendered at the bottom of the page, rather than the top. tried removing all styles from the top/wrapping view of my component, without luck.

Also, I was trying to pass down my redux states, but it seems it isn't part of the props passed to the static method :/

I know this is an old issue. But I get navBar is rendered at the bottom of the page. Tested on latest version (3.36.0)

The only way I could get the navbar to render at the top was to absolute position it like this, and set a height:
position: 'absolute', top: 0, left: 0, right: 0

Was this page helpful?
0 / 5 - 0 ratings