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

feat: add types for header views and back button visibility prop #457

Merged
merged 7 commits into from Apr 15, 2020

Conversation

WoLewicki
Copy link
Member

Added type definitions for headerLeft and headerCenter and an option allowing the custom left view to be rendered to the right of the back button requested in #445.

@@ -73,6 +79,14 @@ export default function HeaderConfig(props: Props) {
{headerRight !== undefined ? (
<ScreenStackHeaderRightView>{headerRight()}</ScreenStackHeaderRightView>
) : null}
{headerLeft !== undefined ? (
Copy link
Collaborator

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?

src/screens.d.ts Outdated Show resolved Hide resolved
@@ -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.
Copy link
Contributor

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

Copy link
Member Author

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.

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 this pull request may close these issues.

None yet

3 participants