@@ -57,11 +57,10 @@ const useScrollToNodeIfNeeded = ({
5757 childRef,
5858 additionalOffset,
5959} : {
60- childRef : React . MutableRefObject < View | null > ;
60+ childRef : React . RefObject < View | null > ;
6161 additionalOffset ?: number ;
6262} ) => {
6363 const { scrollToNodeIfNeeded } = useSpatialNavigatorParentScroll ( ) ;
64-
6564 return ( ) => scrollToNodeIfNeeded ( childRef , additionalOffset ) ;
6665} ;
6766
@@ -70,6 +69,7 @@ const useBindRefToChild = () => {
7069
7170 const bindRefToChild = ( child : React . ReactElement ) => {
7271 return React . cloneElement ( child , {
72+ // @ts -expect-error @fixme can't find how to type this properly -- new error since react 19
7373 ...child . props ,
7474 ref : ( node : View ) => {
7575 // We need the reference for our scroll handling
@@ -138,26 +138,25 @@ export const SpatialNavigationNode = forwardRef<SpatialNavigationNodeRef, Props>
138138 * Therefore, the SpatialNavigator Node callbacks are registered at 1st render but can change (ie. if props change) afterwards.
139139 * Since we want the functions to always be up to date, we use a reference to them.
140140 */
141-
142- const currentOnSelect = useRef < ( ) => void > ( ) ;
141+ const currentOnSelect = useRef < ( ) => void > ( undefined ) ;
143142 currentOnSelect . current = onSelect ;
144143
145- const currentOnLongSelect = useRef < ( ) => void > ( ) ;
144+ const currentOnLongSelect = useRef < ( ) => void > ( undefined ) ;
146145 currentOnLongSelect . current = onLongSelect ;
147146
148- const currentOnFocus = useRef < ( ) => void > ( ) ;
147+ const currentOnFocus = useRef < ( ) => void > ( undefined ) ;
149148 currentOnFocus . current = ( ) => {
150149 onFocus ?.( ) ;
151150 scrollToNodeIfNeeded ( ) ;
152151 } ;
153152
154- const currentOnBlur = useRef < ( ) => void > ( ) ;
153+ const currentOnBlur = useRef < ( ) => void > ( undefined ) ;
155154 currentOnBlur . current = onBlur ;
156155
157- const currentOnActive = useRef < ( ) => void > ( ) ;
156+ const currentOnActive = useRef < ( ) => void > ( undefined ) ;
158157 currentOnActive . current = onActive ;
159158
160- const currentOnInactive = useRef < ( ) => void > ( ) ;
159+ const currentOnInactive = useRef < ( ) => void > ( undefined ) ;
161160 currentOnInactive . current = onInactive ;
162161
163162 const shouldHaveDefaultFocus = useSpatialNavigatorDefaultFocus ( ) ;
@@ -210,7 +209,7 @@ export const SpatialNavigationNode = forwardRef<SpatialNavigationNodeRef, Props>
210209 } , [ id , isFocusable , shouldHaveDefaultFocus , spatialNavigator ] ) ;
211210
212211 // This proxy allows to track whether a property is used or not
213- // hence allowing to ignore re-renders for unused properties
212+ // hence allowing to ignore re-renders for unused pr
214213 const proxyObject = new Proxy (
215214 { isFocused, isActive, isRootActive } ,
216215 {
0 commit comments