Skip to content

Commit

Permalink
docs: fix KeyboardAware types in BottomSheet integration section (#…
Browse files Browse the repository at this point in the history
…465)

## 📜 Description

Added missing `memo` import + fixed props compatibility.

## 💡 Motivation and Context

It is very frustrating when you copy&paste code, but it doesn't work
straight away.

## 📢 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

- added missing `memo` import;
- allow to use `KeyboardAwareScrollViewProps` on BottomSheet wrapper;

## 🤔 How Has This Been Tested?

Tested in code + preview.

## 📝 Checklist

- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
  • Loading branch information
kirillzyusko committed Jun 10, 2024
1 parent 56400db commit 8249e48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/docs/api/components/keyboard-aware-scroll-view.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export default List;
To seamlessly work with [@gorhom/bottom-sheet](https://github.com/gorhom/react-native-bottom-sheet) you will need to wrap `KeyboardAwareScrollView` in some HOCs provided by `@gorhom/bottom-sheet`.

```tsx title="BottomSheetKeyboardAwareScrollView.tsx"
import { memo } from "react";
import {
KeyboardAwareScrollView,
KeyboardAwareScrollViewProps,
Expand All @@ -205,7 +206,7 @@ BottomSheetKeyboardAwareScrollView.displayName =
"BottomSheetKeyboardAwareScrollView";

export default BottomSheetKeyboardAwareScrollView as (
props: BottomSheetScrollViewProps,
props: BottomSheetScrollViewProps & KeyboardAwareScrollViewProps,
) => ReturnType<typeof BottomSheetKeyboardAwareScrollView>;
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export default List;
To seamlessly work with [@gorhom/bottom-sheet](https://github.com/gorhom/react-native-bottom-sheet) you will need to wrap `KeyboardAwareScrollView` in some HOCs provided by `@gorhom/bottom-sheet`.

```tsx title="BottomSheetKeyboardAwareScrollView.tsx"
import { memo } from "react";
import {
KeyboardAwareScrollView,
KeyboardAwareScrollViewProps,
Expand All @@ -205,7 +206,7 @@ BottomSheetKeyboardAwareScrollView.displayName =
"BottomSheetKeyboardAwareScrollView";

export default BottomSheetKeyboardAwareScrollView as (
props: BottomSheetScrollViewProps,
props: BottomSheetScrollViewProps & KeyboardAwareScrollViewProps,
) => ReturnType<typeof BottomSheetKeyboardAwareScrollView>;
```

Expand Down

0 comments on commit 8249e48

Please sign in to comment.