Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to remove StatusBar from Header #3755

Closed
vruffer opened this issue Feb 21, 2023 · 1 comment · Fixed by #3801
Closed

Add ability to remove StatusBar from Header #3755

vruffer opened this issue Feb 21, 2023 · 1 comment · Fixed by #3801

Comments

@vruffer
Copy link

vruffer commented Feb 21, 2023

Is your feature request related to a problem? Please Describe.

Rendering a StatusBar component as a part of the Header component causes a lot of side-effects. Such as not being able to implement custom StatusBar components, like the one described in this react-navigation guide.

Describe the solution you'd like

I think it would make sense to optionally render the StatusBar based on a prop. Such as:

 <Header
  statusBar={false}
/>

which would then make the Header component look something like

<>
  {props.statusBar === true && (
    <StatusBar
      barStyle={barStyle}
      translucent={true}
      backgroundColor={backgroundColor || theme?.colors?.primary}
      {...statusBarProps}
    />
  )}
</>

Describe alternatives you've considered

Since the last StatusBar in the render tree always takes preference, it is quite impossible to do custom logic on the StatusBar somewhere higher in the render tree, so I don't see another option, but please let me know if there's something I'm missing.

Additional context

If there are any issues with the approach that I've missed, please let me know, otherwise I'm happy to open a pull request with the above implementation 😄

@ramizqazi
Copy link
Contributor

I want to contribute this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants