rm forwardRef

This commit is contained in:
Samuel Newman
2025-11-03 11:17:44 +02:00
parent d7750c778f
commit 55a7f03b29
+7 -13
View File
@@ -1,12 +1,9 @@
import {forwardRef, memo, useContext, useMemo} from 'react' import {memo, useContext, useMemo} from 'react'
import { import {
ScrollView, ScrollView,
type ScrollViewProps, type ScrollViewProps,
<<<<<<< HEAD
type StyleProp, type StyleProp,
=======
StyleSheet, StyleSheet,
>>>>>>> c74c5a431 (Revert "rm stylesheet")
View, View,
type ViewProps, type ViewProps,
type ViewStyle, type ViewStyle,
@@ -60,23 +57,21 @@ export const Screen = memo(function Screen({
}) })
export type ContentProps = ScrollViewProps & { export type ContentProps = ScrollViewProps & {
ref?: React.Ref<ScrollView>
ignoreTabletLayoutOffset?: boolean ignoreTabletLayoutOffset?: boolean
} }
/** /**
* Default scroll view for simple pages * Default scroll view for simple pages
*/ */
export const Content = memo( export const Content = memo(function Content({
forwardRef<ScrollView, ContentProps>(function Content( ref,
{
children, children,
style, style,
contentContainerStyle, contentContainerStyle,
ignoreTabletLayoutOffset, ignoreTabletLayoutOffset,
...props ...props
}, }: ContentProps) {
ref,
) {
const t = useTheme() const t = useTheme()
const {footerHeight} = useShellLayout() const {footerHeight} = useShellLayout()
@@ -103,8 +98,7 @@ export const Content = memo(
)} )}
</ScrollView> </ScrollView>
) )
}), })
)
const scrollViewStyles = StyleSheet.create({ const scrollViewStyles = StyleSheet.create({
common: { common: {
@@ -136,7 +130,7 @@ export const KeyboardAwareContent = memo(function LayoutKeyboardAwareContent({
scrollIndicatorInsets={{bottom: footerHeight, top: 0, right: 1}} scrollIndicatorInsets={{bottom: footerHeight, top: 0, right: 1}}
contentInset={ios({top: 0, left: 0, bottom: footerHeight, right: 0})} contentInset={ios({top: 0, left: 0, bottom: footerHeight, right: 0})}
contentContainerStyle={[ contentContainerStyle={[
!isIOS && {paddingBottom: footerHeight}, !IS_IOS && {paddingBottom: footerHeight},
contentContainerStyle, contentContainerStyle,
]} ]}
keyboardShouldPersistTaps="handled" keyboardShouldPersistTaps="handled"