Skip to content

priority about showNavigationBar={false} and hideNavBar={true} #262

@zxcpoiu

Description

@zxcpoiu

Those two props should be the same.

#255 (comment)
#255 (comment)

But even though I have always set hideNavBar={true}, I still encounter issue #258 which can avoid by set showNavigationBar={false} as a workaround if you don't need the nav bar.

I guess:

  • hideNavBar is a prop in react-native-router-flux
  • showNavigationBar is a prop in ex-navigator

should we prioritize/merge them?

for example:

  • priority of hideNavBar is higher than showNavigationBar and overrides it.
  • setting in Router is higher than Route and overrides it.
  • a function in ExRouter.js handle those prop and return true/false

and we can always set prop showNavigationBar specifically in <ExNavigator> in ExRouter.js

below is a similar check like _renderNavigationBar() in ExRouter.js:

// Something like this

shoudHideNavBar(props) {
    const route = this.props.router.nextRoute || this.props.router.currentRoute;
    const hideNavBar = route.props.hideNavBar || this.props.router.props.hideNavBar || route.props.hideNavBar;
    const showNavigationBar = ........

    if (hideNavBar !== 'undefined') {
        .......
    }
    return true/false;
}

what do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions