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
feat: add types for header views and back button visibility prop #457
Conversation
@@ -73,6 +79,14 @@ export default function HeaderConfig(props: Props) { | |||
{headerRight !== undefined ? ( | |||
<ScreenStackHeaderRightView>{headerRight()}</ScreenStackHeaderRightView> | |||
) : null} | |||
{headerLeft !== undefined ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason these were not exposed is because of inconsistent behaviour between Android and iOS. Can you check if it still happens?
@@ -87,21 +91,29 @@ Whether the back button title should be visible or not. Defaults to `true`. Only | |||
|
|||
Function which returns a React Element to display on the right side of the header. | |||
|
|||
#### `headerLeft` | |||
|
|||
Function which returns a React Element to display on the left side of the header. For now, on Android, using it will cause the title to also disappear. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WoLewicki any recommendation on how to implement a custom back button with a title on android? happy to send. PR but needs some guidance on how to proceed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/software-mansion/react-native-screens/pull/457/files#diff-d63d0fa38279f7aa0d11c045d518a176L242 removes the title. You can comment that line and see what happens and work on it to be handled properly.
Added type definitions for
headerLeft
andheaderCenter
and an option allowing the custom left view to be rendered to the right of the back button requested in #445.