Skip to content

How to theming with expo-router on expo 56 #4967

Closed

Description

@gavinliu

In SDK 56 and later, Expo Router no longer supports importing from external @react-navigation/* packages in application code.

https://docs.expo.dev/router/migrate/sdk-55-to-56/

import {
  DarkTheme as NavigationDarkTheme,
  DefaultTheme as NavigationDefaultTheme,
- } from '@react-navigation/native';
+ } from "expo-router/react-navigation";
import { adaptNavigationTheme } from 'react-native-paper';

const { LightTheme, DarkTheme } = adaptNavigationTheme({
  reactNavigationLight: NavigationDefaultTheme,
  reactNavigationDark: NavigationDarkTheme,
});

This will result in a TypeScript type mismatch.

Activity

  1. gavinliu commented on May 28, 2026

    @gavinliu
    Author
    import {
      DarkTheme as NavigationDarkTheme,
      DefaultTheme as NavigationDefaultTheme,
    - } from '@react-navigation/native';
    + } from "expo-router/react-navigation";
    import { adaptNavigationTheme } from 'react-native-paper';
    
    const { LightTheme, DarkTheme } = adaptNavigationTheme({
    -  reactNavigationLight: NavigationDefaultTheme,
    -  reactNavigationDark: NavigationDarkTheme,
    +  reactNavigationLight: NavigationDefaultTheme as any,
    +  reactNavigationDark: NavigationDarkTheme as any,
    });

    AI Fix

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions