Skip to content

feat(theme): export the ThemeProp partial theme type - #5314

Open
Priyanshu0007 wants to merge 1 commit into
callstack:mainfrom
Priyanshu0007:feat/export-theme-prop
Open

Priyanshu0007 wants to merge 1 commit into
callstack:mainfrom
Priyanshu0007:feat/export-theme-prop

Conversation

@Priyanshu0007

Copy link
Copy Markdown

Motivation

PaperProvider, ThemeProvider and Paper's components accept a partial theme, but no type for it was exported. import type { ThemeProp } from 'react-native-paper' failed with TS2305. This exports ThemeProp (type-only, non-breaking) and updates the theming guide to use it instead of ProviderProps['theme'].

Related issue

Closes #5312

Screenshots / Videos

Type-only change, UI is identical before and after.

Test plan

  1. Add import type { ThemeProp } from 'react-native-paper'; and const theme: ThemeProp = { colors: { primary: 'tomato' } };
  2. Run yarn typecheck. Before: TS2305: Module '"react-native-paper"' has no exported member 'ThemeProp'. After: no errors.
  3. Pass it to <PaperProvider theme={theme}> and check the primary color changes.

@Doberjohn Doberjohn added this to the 6.1.0 milestone Nov 24, 2026

This branch has not been deployed

No deployments
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.

Export the partial theme type (ThemeProp) from react-native-paper

2 participants