Skip to content

Commit

Permalink
Merge pull request #29 from vue-styled-components/fix/typedef-jsx
Browse files Browse the repository at this point in the history
fix(core): the type definition of jsx is not well defined(#28)
  • Loading branch information
akinoccc authored Aug 31, 2024
2 parents 42d5e2a + e2bc882 commit 91d21c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import {
reactive,
ref,
watch,
HTMLAttributes,
} from 'vue'
import domElements, { type SupportedHTMLElements } from '@/src/constants/domElements'
import { type ExpressionType, generateClassName, generateComponentName, insertExpressions, injectStyle, removeStyle } from '@/src/utils'
import { isStyledComponent, isValidElementType, isVueComponent } from '@/src/helper'
import type { DefaultTheme } from './providers/theme'
import { JSX } from 'vue/jsx-runtime'

type Attrs = Record<string, any>

Expand All @@ -33,7 +33,7 @@ interface StyledComponent<T extends object> {
| ExpressionType<BaseContext<P & ExtractPropTypes<PropsDefinition<T>>>>
| ExpressionType<BaseContext<P & ExtractPropTypes<PropsDefinition<T>>>>[]
)[]
): DefineSetupFnComponent<{ as?: string; props?: P } & ExtractPropTypes<PropsDefinition<T>> & JSX.IntrinsicElements['div']>
): DefineSetupFnComponent<{ as?: string; props?: P } & ExtractPropTypes<PropsDefinition<T>> & HTMLAttributes>

attrs<A extends Attrs = Record<string, any>>(attrs: A): StyledComponent<T>
}
Expand Down
5 changes: 5 additions & 0 deletions packages/playground/src/Test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { styled } from '@/src/styled'

export const Test1 = styled.div``

export const Test2 = () => <Test1 class={'555'} />

0 comments on commit 91d21c3

Please sign in to comment.