Skip to content

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

Backlog

Description

@Doberjohn

Is your feature request related to a problem? Please describe.

PaperProvider and ThemeProvider take a partial theme in theme, but react-native-paper exports no type for it, so a partial theme kept in a variable is hard to type. import type { ThemeProp } from 'react-native-paper' fails with TS2305: Module '"react-native-paper"' has no exported member 'ThemeProp', and Theme requires every key (TS2740: Type '{ primary: string; }' is missing the following properties from type 'ThemeColors').

Describe the solution you'd like

import type { ThemeProp } from 'react-native-paper' works, as the type of the providers' theme prop.

Describe alternatives you've considered

ProviderProps['theme'] works today.

Additional context

A new export, so it fits a 6.x minor.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions