Skip to content

Type 'MD3Theme' is not assignable to type 'NavigationTheme'. #4531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andrewhamili opened this issue Oct 21, 2024 · 2 comments
Closed

Type 'MD3Theme' is not assignable to type 'NavigationTheme'. #4531

andrewhamili opened this issue Oct 21, 2024 · 2 comments
Labels
question Question related to the library, not an issue Theme utilities

Comments

@andrewhamili
Copy link

Ask your Question

image
What is causing this issue?
image

I have been using adaptNavigationTheme for quite a while. But as of yesterday, I have been experiencing this error, although there were no issues when testing on iOS and Android. I also generated a release build for Android and it didn't report any issues.

@andrewhamili andrewhamili added the question Question related to the library, not an issue label Oct 21, 2024
@jony89
Copy link

jony89 commented Oct 28, 2024

adaptNavigationTheme expects to get the @react-navigation/native themes and not react native paper.

import {
  DarkTheme as NavigationDarkTheme,
  DefaultTheme as NavigationDefaultTheme,
} from '@react-navigation/native';

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

@lukewalczak
Copy link
Member

As @jony89 mentioned and according to the documentation valid themes for reactNavigationLight and reactNavigationDark themes from react navigation library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question related to the library, not an issue Theme utilities
Projects
None yet
Development

No branches or pull requests

3 participants