From 1e4deef62997b3e1cbc76645c61f19f6b96a38ad Mon Sep 17 00:00:00 2001 From: Jakub Biesiada Date: Thu, 16 Jun 2022 00:24:02 +0200 Subject: [PATCH] feat: return View insetad of ScrollView when scroll is disabled --- src/index.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 134be3c..2661058 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,5 +1,5 @@ import React, { useCallback, useMemo, useState, useEffect } from 'react'; -import { ScrollViewProps, ScrollView } from 'react-native'; +import { ScrollViewProps, ScrollView, View } from 'react-native'; interface Props extends ScrollViewProps { readonly children: React.ReactNode; @@ -56,8 +56,12 @@ const SmartScrollContainer = ({ [horizontal, onContentSizeChange] ); + // TODO: fix sizing/positioning + const Component = !scrollEnabled && !horizontal ? View : ScrollView; + return ( - {children} - + ); };