Skip to main content
Version: 0.4.0

Migration from react-native-tab-view

reanimated-tab-view is designed to be largely API-compatible with react-native-tab-view. This guide covers the key differences and steps to migrate.

Installation changes

Remove react-native-tab-view and react-native-pager-view, then install reanimated-tab-view:

# Remove old packages
yarn remove react-native-tab-view react-native-pager-view

# Install reanimated-tab-view
yarn add reanimated-tab-view

Ensure react-native-reanimated (>= 3.0.0) and react-native-gesture-handler (>= 2.9.0) are installed.

Import changes

- import { TabView, TabBar } from 'react-native-tab-view';
+ import { TabView, TabBar } from 'reanimated-tab-view';

API compatibility

Most props work the same way:

PropCompatibleNotes
navigationStateYesSame API
renderSceneYesSame API
onIndexChangeYesSame API
renderTabBarMovedNow inside tabBarConfig.renderTabBar
tabBarPositionMovedNow inside tabBarConfig.tabBarPosition
initialLayoutChangedNow accepts { tabView, tabViewHeader, tabBar } object
lazyChangedUse renderMode="lazy" instead
swipeEnabledYesSame API
keyboardDismissModeYesSame API

Key differences

Tab bar configuration

Tab bar props are now grouped under tabBarConfig:

  <TabView
- renderTabBar={(props) => <TabBar {...props} />}
- tabBarPosition="top"
+ tabBarConfig={{
+ renderTabBar: (props) => <TabBar {...props} />,
+ tabBarPosition: 'top',
+ }}
/>

Lazy rendering

  <TabView
- lazy
+ renderMode="lazy"
/>

Initial layout

  <TabView
- initialLayout={{ width: layout.width }}
+ initialLayout={{ tabView: { width: layout.width } }}
/>

New features available after migration

After migrating, you gain access to features not available in react-native-tab-view:

  • Collapsible headers via renderHeader prop
  • Windowed render mode for balanced performance
  • Smooth jump mode preventing blank flashes
  • Dynamic tab widths following Material Design spec
  • No react-native-pager-view dependency - fewer native module issues