@@ -10,8 +10,10 @@ import {
1010 type DimensionValue ,
1111 Image ,
1212 Platform ,
13+ type StyleProp ,
1314 StyleSheet ,
1415 View ,
16+ type ViewStyle ,
1517 processColor ,
1618} from 'react-native' ;
1719import { BottomTabBarHeightContext } from './utils/BottomTabBarHeightContext' ;
@@ -139,6 +141,11 @@ interface Props<Route extends BaseRoute> {
139141 */
140142 getFreezeOnBlur ?: ( props : { route : Route } ) => boolean | undefined ;
141143
144+ /**
145+ * Get style for the scene, uses `route.style` by default.
146+ */
147+ getSceneStyle ?: ( props : { route : Route } ) => StyleProp < ViewStyle > ;
148+
142149 tabBarStyle ?: {
143150 /**
144151 * Background color of the tab bar.
@@ -196,6 +203,7 @@ const TabView = <Route extends BaseRoute>({
196203 getActiveTintColor = ( { route } : { route : Route } ) => route . activeTintColor ,
197204 getTestID = ( { route } : { route : Route } ) => route . testID ,
198205 getRole = ( { route } : { route : Route } ) => route . role ,
206+ getSceneStyle = ( { route } : { route : Route } ) => route . style ,
199207 hapticFeedbackEnabled = false ,
200208 // Android's native behavior is to show labels when there are less than 4 tabs. We leave it as undefined to use the platform default behavior.
201209 labeled = Platform . OS !== 'android' ? true : undefined ,
@@ -374,12 +382,15 @@ const TabView = <Route extends BaseRoute>({
374382 const focused = route . key === focusedKey ;
375383 const freeze = ! focused ? getFreezeOnBlur ( { route } ) : false ;
376384
385+ const customStyle = getSceneStyle ( { route } ) ;
386+
377387 return (
378388 < View
379389 key = { route . key }
380390 style = { [
381391 styles . screen ,
382392 renderCustomTabBar ? styles . fullWidth : measuredDimensions ,
393+ customStyle ,
383394 ] }
384395 collapsable = { false }
385396 pointerEvents = { focused ? 'auto' : 'none' }
0 commit comments