Skip to content

Commit dd9271e

Browse files
Esemeseksouhe
authored andcommitted
Fix/typescript types (#26)
* fix Fix partial theme property * fix Theme is an optional type
1 parent 7ae847c commit dd9271e

File tree

3 files changed

+788
-1
lines changed

3 files changed

+788
-1
lines changed

typings/__tests__/index.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@ const ThemedTitle = withTheme(TitleComponent);
5555
const App = () => (
5656
<ThemeProvider theme={themes.default}>
5757
<ThemedTitle title="React Theme Provider" theme={{ primaryColor: 'pink' }} />
58+
<ThemedTitle title="Second title" />
5859
</ThemeProvider>
5960
);

typings/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type ThemingType<Theme, PartialTheme> = {
1111
ThemeProvider: ThemeProviderType<Theme>;
1212
withTheme: <Props extends { theme: Theme }>(
1313
Comp: React.ComponentType<Props>
14-
) => React.ComponentType<Without<Props, "theme"> & { theme: PartialTheme }>;
14+
) => React.ComponentType<Without<Props, "theme"> & { theme?: PartialTheme }>;
1515
};
1616

1717
// Library exports

0 commit comments

Comments
 (0)