Skip to content

Commit

Permalink
fix: typerror when using FontFamilyProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
bbohlender committed Mar 25, 2024
1 parent 9f1149f commit 85a1e68
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/uikit/src/text/react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ const fontWeightNames = {

export type FontWeight = keyof typeof fontWeightNames | number

export function FontFamilyProvider({
children,
...fontFamilies
}: Record<string, FontFamilyUrls> & { children?: ReactNode }) {
export function FontFamilyProvider<T extends string = never>(properties: {
[Key in T]: Key extends 'children' ? ReactNode : FontFamilyUrls
}) {
let { children, ...fontFamilies } = properties as any
const existinFontFamilyUrls = useContext(FontFamiliesContext)
if (existinFontFamilyUrls != null) {
fontFamilies = { ...existinFontFamilyUrls, ...fontFamilies }
Expand Down

0 comments on commit 85a1e68

Please sign in to comment.