react-native-paper
react-native-paper copied to clipboard
feat: adjust theme types to match internal and regular usage
During the development we came to the conclusion that useTheme right now has to serve too many roles - support two themes at the same time for internal components and later on support just one theme when used by developers including react-native-paper into their applications
Summary
- [x] Added
useInternalThemehook for internal usage - [x] Added
withInternalThemeHOC for internal usage - [x] Renamed global type definition
- [x] Change usage inside internal components
- [x] Raised a PR in
@callstack/react-theme-providerto allow typing hooks
Test plan
Due to the usage of global index.d.ts files I had troubles with testing the implementation inside example folder. My idea now is to create a separate app, include react-native-paper from this branch and see if global theme overrides work properly
@lukewalczak CircleCI tests fail due to missing implementation in @callstack/react-theme-provider - I'll raise the PR today
Hey @Drakeoon, thank you for your pull request 🤗. The documentation from this branch can be viewed here.
The mobile version of example app from this branch is ready! You can see it here.
The mobile version of example app from this branch is ready! You can see it here.
The mobile version of example app from this branch is ready! You can see it here.
The mobile version of example app from this branch is ready! You can see it here.
The mobile version of example app from this branch is ready! You can see it here.
The mobile version of example app from this branch is ready! You can see it here.