Skip to content

Commit 2711117

Browse files
authored
fix(android): default ScreenStackHeaderSubview type is LEFT (#3619)
## Description <!-- Description and motivation for this PR. This section should include "what & why". Please link all related issues that merging this PR should close, by using the `Closes #<issue-number>` syntax. For example: Closes #12345. --> The default value for. the `ScreenStackHeaderSubview` type is `LEFT`. This can also be derived from the codegen spec: https://github.com/software-mansion/react-native-screens/blob/c72539d598d37ccbcd44a380ce017441fc8b3eed/src/fabric/ScreenStackHeaderSubviewNativeComponent.ts#L15 Now, its important that the native side always matches the codegen side. I noticed this since i was turning on the new props 2.0 diffing mechanism. With that enabled, you won't receive props on the native view manager side that are equal to the default prop value. See here: <img width="2841" height="525" alt="Screenshot 2026-02-04 at 16 43 38" src="https://github.com/user-attachments/assets/3ae47738-7e75-4d8a-b24f-a04e80c096e3" /> This is not a bug in react-native, that's how they intended it, see this issue: - facebook/react-native#55249 (comment) ## Changes <!-- This is "how" of the PR description. Please describe things you've changed here, make a **high level** overview, if change is simple you can omit this section. For example: - Updated `about.md` docs --> Change default type from right to left to match codegen spec. ## Before & after - visual documentation <!-- This section is MANDATORY for any PR that introduces any visual changes. If your PR does not introduce such changes, please omit this section. Consider using a table here to position the recordings / screenshots next to each other. | Before | After | | --- | --- | | ![Before](before.png) | ![After](after.png) | Alternatively add two sections - Before & After ### Before ### After --> ## Test plan <!-- Please name all newly added and existing test files that you tested the changes with. This section should also contain short description of steps to reproduce the issue. The reproduction code should be minimal & complete. Don't exclude exports or remove "not important" parts of reproduction example. --> ## Checklist - [ ] Included code example that can be used to test this change. - [ ] Updated / created local changelog entries in relevant test files. - [ ] For visual changes, included screenshots / GIFs / recordings documenting the change. - [ ] For API changes, updated relevant public types. - [ ] Ensured that CI passes
1 parent c72539d commit 2711117

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubview.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ScreenStackHeaderSubview(
1818
*/
1919
private var isReactSizeSet = false
2020

21-
var type = Type.RIGHT
21+
var type = Type.LEFT
2222

2323
val config: ScreenStackHeaderConfig?
2424
get() = (parent as? CustomToolbar)?.config

0 commit comments

Comments
 (0)