feat: use forwardRef with DrawerContentScrollView (#9695)

Closes #9350
This commit is contained in:
Kazuaki Horita
2021-08-07 22:12:06 +09:00
committed by GitHub
parent 40dcbcf2fa
commit ebb5f24664

View File

@@ -13,12 +13,10 @@ type Props = ScrollViewProps & {
children: React.ReactNode;
};
export default function DrawerContentScrollView({
contentContainerStyle,
style,
children,
...rest
}: Props) {
function DrawerContentScrollView(
{ contentContainerStyle, style, children, ...rest }: Props,
ref?: React.Ref<ScrollView>
) {
const drawerPosition = React.useContext(DrawerPositionContext);
const insets = useSafeAreaInsets();
@@ -29,6 +27,7 @@ export default function DrawerContentScrollView({
return (
<ScrollView
{...rest}
ref={ref}
contentContainerStyle={[
{
paddingTop: insets.top + 4,
@@ -44,6 +43,8 @@ export default function DrawerContentScrollView({
);
}
export default React.forwardRef(DrawerContentScrollView);
const styles = StyleSheet.create({
container: {
flex: 1,