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

refactor: conditional types for KeyboardAvoidingView #711

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

kirillzyusko
Copy link
Owner

@kirillzyusko kirillzyusko commented Nov 28, 2024

📜 Description

contentContainerStyle can be used only when behavior="position".

💡 Motivation and Context

To eep people aware about that additionally I decided to specify conditional TS types. Now people will get a warning if they specify this property and don't specify behavior as position.

📢 Changelog

JS

  • add conditional types to KeyboardAvoidingView;

🤔 How Has This Been Tested?

Tested in example project.

📸 Screenshots (if appropriate):

Forbidden

image

Allowed

image

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko added the KeyboardAvoidingView 🧪 Anything related to KeyboardAvoidingView component label Nov 28, 2024
@kirillzyusko kirillzyusko self-assigned this Nov 28, 2024
Copy link
Contributor

github-actions bot commented Nov 28, 2024

📊 Package size report

Current size Target Size Difference
162024 bytes 161768 bytes 256 bytes 📈

@kirillzyusko kirillzyusko marked this pull request as ready for review December 2, 2024 15:23
@kirillzyusko kirillzyusko merged commit 5ded2a7 into main Dec 2, 2024
12 checks passed
@kirillzyusko kirillzyusko deleted the fix/kav-conditional-types branch December 2, 2024 15:24
kirillzyusko added a commit that referenced this pull request Dec 16, 2024
## 📜 Description

Remove `contentContainerStyle` for `KeyboardAvoidingView` in
documentation as it's not needed and after
#711
it trigerrs TS errors.

## 💡 Motivation and Context

Conditional types were added intentionally to spot issues like this.
Glad to see it works 😅

Closes
#732

## 📢 Changelog

<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->

### Docs

- remove `contentContainerStyle` for `KeyboardAvoidingView`.

## 🤔 How Has This Been Tested?

Tested on localhost:3000

## 📝 Checklist

- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
KeyboardAvoidingView 🧪 Anything related to KeyboardAvoidingView component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant