Skip to content

Commit c7cf14c

Browse files
committed
fix: port changes to 1.17.0
1 parent 744f6b5 commit c7cf14c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

docs/versioned_docs/version-1.17.0/api/components/keyboard-aware-scroll-view.mdx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ Unlike original [react-native-keyboard-aware-scroll-view](https://github.com/APS
124124
If you want to integrate it with your custom virtualization list, you can pass `renderScrollComponent` prop like:
125125

126126
```tsx
127-
import { FlatList } from "react-native";
127+
import React from "react";
128+
import { FlatList, ScrollView, ScrollViewProps } from "react-native";
128129
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
129130

130131
<FlatList
@@ -135,9 +136,11 @@ import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
135136

136137
import { FlashList } from "@shopify/flash-list";
137138

138-
<FlashList
139-
renderScrollComponent={(props) => <KeyboardAwareScrollView {...props} />}
140-
/>;
139+
const RenderScrollComponent = React.forwardRef<ScrollView, ScrollViewProps>(
140+
(props, ref) => <KeyboardAwareScrollView {...props} ref={ref} />,
141+
);
142+
143+
<FlashList renderScrollComponent={RenderScrollComponent} />;
141144
```
142145

143146
<details>

0 commit comments

Comments
 (0)