File tree Expand file tree Collapse file tree 4 files changed +10
-12
lines changed Expand file tree Collapse file tree 4 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
160160 handleComponent,
161161 backdropComponent,
162162 backgroundComponent,
163- footerComponent ,
163+ renderFooter ,
164164 children : Content ,
165165
166166 // accessibility
@@ -1659,10 +1659,8 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
16591659 >
16601660 { typeof Content === 'function' ? < Content /> : Content }
16611661
1662- { footerComponent && (
1663- < BottomSheetFooterContainer
1664- footerComponent = { footerComponent }
1665- />
1662+ { renderFooter && (
1663+ < BottomSheetFooterContainer renderFooter = { renderFooter } />
16661664 ) }
16671665 </ BottomSheetDraggableView >
16681666 </ Animated . View >
Original file line number Diff line number Diff line change @@ -299,11 +299,11 @@ export interface BottomSheetProps
299299 */
300300 backgroundComponent ?: React . FC < BottomSheetBackgroundProps > | null ;
301301 /**
302- * Component to be placed as a footer.
302+ * Function to render as the footer.
303303 * @see {BottomSheetFooterProps}
304- * @type React.FC\< BottomSheetFooterProps\>
304+ * @type (props: BottomSheetFooterProps) => React.ReactElement | null;
305305 */
306- footerComponent ?: React . FC < BottomSheetFooterProps > ;
306+ renderFooter ?: ( props : BottomSheetFooterProps ) => React . ReactElement | null ;
307307 /**
308308 * A scrollable node or normal view.
309309 * @type (() => React.ReactElement) | React.ReactNode[] | React.ReactNode
Original file line number Diff line number Diff line change 1- import React , { memo } from 'react' ;
1+ import { memo } from 'react' ;
22import { useDerivedValue } from 'react-native-reanimated' ;
33import { useBottomSheetInternal } from '../../hooks' ;
44import { KEYBOARD_STATE } from '../../constants' ;
55import type { BottomSheetFooterContainerProps } from './types' ;
66
77const BottomSheetFooterContainerComponent = ( {
8- footerComponent : FooterComponent ,
8+ renderFooter ,
99} : BottomSheetFooterContainerProps ) => {
1010 //#region hooks
1111 const {
@@ -46,7 +46,7 @@ const BottomSheetFooterContainerComponent = ({
4646 ] ) ;
4747 //#endregion
4848
49- return < FooterComponent animatedFooterPosition = { animatedFooterPosition } /> ;
49+ return renderFooter ( { animatedFooterPosition } ) ;
5050} ;
5151
5252const BottomSheetFooterContainer = memo ( BottomSheetFooterContainerComponent ) ;
Original file line number Diff line number Diff line change 11import type { BottomSheetProps } from '../bottomSheet' ;
22
33export interface BottomSheetFooterContainerProps
4- extends Required < Pick < BottomSheetProps , 'footerComponent ' > > { }
4+ extends Required < Pick < BottomSheetProps , 'renderFooter ' > > { }
You can’t perform that action at this time.
0 commit comments