@@ -299,13 +299,12 @@ const TabView = <Route extends BaseRoute>({
299299 }
300300 return navigationState . routes ;
301301 } , [ navigationState . routes ] ) ;
302- const shouldDeferUnloadedLazySelection =
303- Platform . OS === 'ios' && parseFloat ( String ( Platform . Version ) ) >= 26 ;
304302
305303 /**
306304 * List of loaded tabs, tabs will be loaded when navigated to.
307305 */
308306 const [ loaded , setLoaded ] = React . useState < string [ ] > ( [ focusedKey ] ) ;
307+
309308 if ( ! loaded . includes ( focusedKey ) ) {
310309 // Set the current tab to be loaded if it was not loaded before
311310 setLoaded ( ( loaded ) => [ ...loaded , focusedKey ] ) ;
@@ -348,11 +347,7 @@ const TabView = <Route extends BaseRoute>({
348347 hidden : getHidden ?.( { route } ) ,
349348 testID : getTestID ?.( { route } ) ,
350349 role : getRole ?.( { route } ) ,
351- preventsDefault :
352- getPreventsDefault ?.( { route } ) ||
353- ( shouldDeferUnloadedLazySelection &&
354- getLazy ( { route } ) !== false &&
355- ! loaded . includes ( route . key ) ) ,
350+ preventsDefault : getPreventsDefault ?.( { route } ) ,
356351 } ;
357352 } ) ,
358353 [
@@ -368,9 +363,6 @@ const TabView = <Route extends BaseRoute>({
368363 getTestID ,
369364 getRole ,
370365 getPreventsDefault ,
371- getLazy ,
372- loaded ,
373- shouldDeferUnloadedLazySelection ,
374366 ]
375367 ) ;
376368
@@ -392,12 +384,6 @@ const TabView = <Route extends BaseRoute>({
392384 onIndexChange ( index ) ;
393385 } ) ;
394386
395- const hasUnloadedLazyRoute =
396- shouldDeferUnloadedLazySelection &&
397- trimmedRoutes . some (
398- ( route ) => getLazy ( { route } ) !== false && ! loaded . includes ( route . key )
399- ) ;
400-
401387 const handleTabLongPress = React . useCallback (
402388 ( { nativeEvent : { key } } : { nativeEvent : OnPageSelectedEventData } ) => {
403389 const index = trimmedRoutes . findIndex ( ( route ) => route . key === key ) ;
@@ -408,22 +394,9 @@ const TabView = <Route extends BaseRoute>({
408394
409395 const handlePageSelected = React . useCallback (
410396 ( { nativeEvent : { key } } : { nativeEvent : OnPageSelectedEventData } ) => {
411- const route = trimmedRoutes . find ( ( route ) => route . key === key ) ;
412- const preventsDefault = route ? getPreventsDefault ( { route } ) : false ;
413-
414- if ( route && ! preventsDefault ) {
415- setLoaded ( ( loaded ) =>
416- loaded . includes ( key ) ? loaded : [ ...loaded , key ]
417- ) ;
418- }
419-
420397 jumpTo ( key ) ;
421398 } ,
422- [
423- getPreventsDefault ,
424- jumpTo ,
425- trimmedRoutes ,
426- ]
399+ [ jumpTo ]
427400 ) ;
428401
429402 const handleTabBarMeasured = React . useCallback (
@@ -469,34 +442,27 @@ const TabView = <Route extends BaseRoute>({
469442 activeTintColor = { activeTintColor }
470443 inactiveTintColor = { inactiveTintColor }
471444 experimentalBakedTintColors = { experimentalBakedTintColors }
472- disablePageAnimations = {
473- props . disablePageAnimations || hasUnloadedLazyRoute
474- }
475445 barTintColor = { tabBarStyle ?. backgroundColor }
476446 rippleColor = { rippleColor }
477447 labeled = { labeled }
478448 >
479449 { trimmedRoutes . map ( ( route ) => {
480- const customStyle = getSceneStyle ( { route } ) ;
481-
482450 if ( getLazy ( { route } ) !== false && ! loaded . includes ( route . key ) ) {
483451 // Don't render a screen if we've never navigated to it
484452 return (
485453 < View
486454 key = { route . key }
487455 collapsable = { false }
488- style = { [
489- styles . screen ,
490- renderCustomTabBar ? styles . fullWidth : measuredDimensions ,
491- customStyle ,
492- ] }
456+ style = { styles . fullWidth }
493457 />
494458 ) ;
495459 }
496460
497461 const focused = route . key === focusedKey ;
498462 const freeze = ! focused ? getFreezeOnBlur ( { route } ) : false ;
499463
464+ const customStyle = getSceneStyle ( { route } ) ;
465+
500466 return (
501467 < View
502468 key = { route . key }
0 commit comments