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 compat mode for previously removed formSheet prop values #2356

Merged
merged 9 commits into from
Sep 30, 2024

Conversation

kkafar
Copy link
Member

@kkafar kkafar commented Sep 27, 2024

Description

This PR intends to add support for previously removed sheetAllowedDetents and sheetLargestUndimmedDetent props values: medium, large and all.

With addition of custom detents for iOS I've changed the API of NativeScreen component to receive number[] as the detent list and removed the old options. This removal was unnecessary. I've restored these options on the Screen component abstraction layer, where old options are translated to the new API w/o need for additional support in downstream packages such as react-navigation.

Corresponding PR in react-navigation:

Changes

  • updated the types,
  • added "translation layer" in InnerScreen.

Test code and steps to reproduce

Test1649 is great for testing all sheet related props.

Checklist

@kkafar kkafar self-assigned this Sep 28, 2024
@kkafar
Copy link
Member Author

kkafar commented Sep 30, 2024

I'm merging changes to react-navigation to keep things working. I'll update react-navigation to main, once we land these PRs there.

@kkafar kkafar merged commit c981c06 into main Sep 30, 2024
3 checks passed
@kkafar kkafar deleted the @kkafar/formsheet-compat-mode branch September 30, 2024 06:29
ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this pull request Oct 9, 2024
…oftware-mansion#2356)

## Description

This PR intends to add support for previously removed
`sheetAllowedDetents` and `sheetLargestUndimmedDetent` props values:
`medium`, `large` and `all`.

With addition of custom detents for iOS I've changed the API of
NativeScreen component to receive `number[]` as the detent list and
removed the old options. This removal was unnecessary. I've restored
these options on the `Screen` component abstraction layer, where old
options are translated to the new API w/o need for additional support in
downstream packages such as react-navigation.

Corresponding PR in `react-navigation`:

* react-navigation/react-navigation#12032

## Changes

* updated the types,
* added "translation layer" in InnerScreen.


## Test code and steps to reproduce

Test1649 is great for testing all sheet related props.

## Checklist

- [x] Included code example that can be used to test this change
- [x] Updated TS types
- [x] Updated documentation: <!-- For adding new props to native-stack
-->
- [x]
https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md
- [x]
https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md
- [x]
https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx
- [x]
https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx
- [x] Ensured that CI passes
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.

1 participant