Skip to content

feat(v6): remove deprecated public API#4926

Open
adrcotfas wants to merge 1 commit into
@adrcotfas/refactor/dynamic_themesfrom
@adrcotfas/refactor/remove_deprecation
Open

feat(v6): remove deprecated public API#4926
adrcotfas wants to merge 1 commit into
@adrcotfas/refactor/dynamic_themesfrom
@adrcotfas/refactor/remove_deprecation

Conversation

@adrcotfas
Copy link
Copy Markdown
Collaborator

@adrcotfas adrcotfas commented May 8, 2026

Motivation

  • Delete src/deprecated.ts and all MD3*/DefaultTheme/useAppTheme re-exports
  • Remove createMaterialBottomTabNavigator and entire src/react-navigation/ directory
  • Remove theme.mode field from Theme type and DarkTheme definition
  • Remove ThemeBase type
  • Remove deprecated component props: FAB.small, Button.color, BottomNavigation BaseRoute.color
  • Remove Card adaptive dark mode logic (tonal surfaces handle dark theme in MD3)
  • Update example app and docs to use canonical names (Palette, LightTheme, DarkTheme)
  • Rename internal useAppTheme to _useTheme to avoid confusion with removed public symbol

Related issue

See https://www.notion.so/callstack/React-Native-Paper-Foundation-for-MD3-Expressive-34c5d027c0f880edba3df107cd35946f?source=copy_link

Merge order:

Test plan

  • yarn typescript -- no new type errors
  • yarn test -- all tests pass

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

The mobile version of example app from this branch is ready! You can see it here.

- Delete src/deprecated.ts and all MD3*/DefaultTheme/useAppTheme re-exports
- Remove createMaterialBottomTabNavigator and entire src/react-navigation/ directory
- Remove theme.mode field from Theme type and DarkTheme definition
- Remove ThemeBase type
- Remove deprecated component props: FAB.small, Button.color, BottomNavigation BaseRoute.color
- Remove Card adaptive dark mode logic (tonal surfaces handle dark theme in MD3)
- Update example app and docs to use canonical names (Palette, LightTheme, DarkTheme)
- Rename internal useAppTheme to _useTheme to avoid confusion with removed public symbol
@adrcotfas adrcotfas force-pushed the @adrcotfas/refactor/remove_deprecation branch from 469ac47 to cf203b2 Compare May 12, 2026 15:08
@adrcotfas adrcotfas requested a review from satya164 May 12, 2026 15:08
@callstack-bot
Copy link
Copy Markdown

Hey @adrcotfas, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

Comment thread src/theme/provider.tsx
Comment on lines +17 to +22
return _useTheme<T>(overrides);
}

export const useInternalTheme = (
themeOverrides: $DeepPartial<Theme> | undefined
) => useAppTheme<Theme>(themeOverrides);
) => _useTheme<Theme>(themeOverrides);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally we don't use _ prefix for functions, only for class properties to signify they are internal to class as they are accessible by anyone with access to the class instance. For functions already scoped to module/other functions, it's an unnecessary signal.

);
const computedElevation =
dark && isAdaptiveMode ? elevationDarkAdaptive : elevation;
const computedElevation = elevation;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess we can remove computedElevation and use elevation directly? Otherwise, it's confusing since nothing is computed.

import { useTheme, type Theme } from 'react-native-paper';

export const useExampleTheme = () => useTheme<MD3Theme>();
export const useExampleTheme = () => useTheme<Theme>();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this hook do? Seems like nothing 🤔

The `createMaterialBottomTabNavigator` has been deprecated as of `[email protected]`. Instead, use `@react-navigation/bottom-tabs` version `7.x` or later, combined with `BottomNavigation.Bar` to achieve a Material Design look.

For implementation details, see the [dedicated example](https://callstack.github.io/react-native-paper/docs/components/BottomNavigation/BottomNavigationBar#with-react-navigation).
`createMaterialBottomTabNavigator` was deprecated in `[email protected]` and removed in `[email protected]`. Use [`@react-navigation/bottom-tabs`](https://reactnavigation.org/docs/bottom-tab-navigator) (v7+) with [`BottomNavigation.Bar`](https://callstack.github.io/react-native-paper/docs/components/BottomNavigation/BottomNavigationBar) instead.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already instructions for React Navigation belo, and this will be in the upgrade guide, so I'd remove it from here.


:::info
To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](https://reactnavigation.org/docs/getting-started):
Install [`@react-navigation/native`](https://reactnavigation.org/docs/getting-started) and [`@react-navigation/bottom-tabs@^7`](https://reactnavigation.org/docs/bottom-tab-navigator) first.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove ^7. This guide will also work on 8.x and 6.x (tho no animation on 6.x).

Comment on lines +36 to +39
tabBar={({ navigation, state, descriptors, insets }) => (
<BottomNavigation.Bar
navigationState={state}
safeAreaInsets={insets}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For upcoming React Navigation 8 compatibility, let's remove insets argument.

Add const insets = useSafeAreaInsets() from react-native-safe-area-context in the MyTabs component and pass insets from there (unless it's already handled by default in BottomNavigation.Bar).

options={{
tabBarLabel: 'Home',
tabBarIcon: ({ color }) => (
<MaterialDesignIcons name="home" color={color} size={26} />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change correct? What are we using in other places?

Also, iirc upcoming Expo SDK no longer needs @expo/vector-icons.

Comment on lines +102 to +111
## Migration

| Old (removed) | New |
|---|---|
| `createMaterialBottomTabNavigator()` | `createBottomTabNavigator()` from `@react-navigation/bottom-tabs` |
| `<Tab.Navigator activeColor inactiveColor barStyle shifting labeled theme>` | Pass the same props to `<BottomNavigation.Bar>` inside `tabBar` |
| `options.tabBarIcon` / `tabBarLabel` / `tabBarBadge` | Same names; read via `descriptors[route.key].options` in `renderIcon` / `getLabelText` |
| `options.tabBarColor` (theme v2) | Removed. MD3 uses tonal surface colors. |
| `navigation.jumpTo(name, params)` | Same. Provided by `@react-navigation/bottom-tabs`. |
| `tabPress` event | Same. Emitted by `@react-navigation/bottom-tabs`. |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need migration in individual guides. We need to have a central guide for migrating to v6 that mentions all breaking changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants