We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ec83ed commit 8946ccbCopy full SHA for 8946ccb
packages/styled-components/src/theme.ts
@@ -1,8 +1,13 @@
1
import { createUseGetter } from '@xstyled/core'
2
-import { th } from '@xstyled/system'
3
-import { useTheme } from 'styled-components'
+import { th, Theme } from '@xstyled/system'
+import { useTheme as useScTheme } from 'styled-components'
4
5
-export { useTheme }
+/**
6
+ * Passthrough to styled-components `useTheme`, but returning the xstyled `Theme` type.
7
+ */
8
+export function useTheme(): Theme {
9
+ return useScTheme()
10
+}
11
12
export const useTh = createUseGetter(th, useTheme)
13
0 commit comments