File tree Expand file tree Collapse file tree
src/components/KeyboardAvoidingView Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ const KeyboardAvoidingView = forwardRef<
9292 ref ,
9393 ) => {
9494 const initialFrame = useSharedValue < LayoutRectangle | null > ( null ) ;
95- const internalRef = React . useRef < View > ( null ) ;
95+ const internalRef = React . useRef < View | null > ( null ) ;
9696 const frame = useDerivedValue ( ( ) => initialFrame . value || defaultLayout ) ;
9797
9898 const { translate, padding } = useTranslateAnimation ( ) ;
@@ -209,9 +209,11 @@ const KeyboardAvoidingView = forwardRef<
209209 } , [ behavior , enabled , interpolateToRelativeKeyboardHeight ] ) ;
210210 const combinedRef = useCallback (
211211 ( node : View | null ) => {
212- ( internalRef as React . MutableRefObject < View | null > ) . current = node ;
212+ internalRef . current = node ;
213213
214214 if ( typeof ref === "function" ) ref ( node ) ;
215+ // ForwardedRef includes RefObject whose .current is readonly in TS,
216+ // but React always passes a mutable ref object at runtime.
215217 else if ( ref )
216218 ( ref as React . MutableRefObject < View | null > ) . current = node ;
217219 } ,
You can’t perform that action at this time.
0 commit comments