Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently use React namespace to use JSX types #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export type CSSRule = [className: string, rule?: string]

type ClassNameMessage = 'Component must accept a className prop'

export type AcceptsClassName<T> = T extends keyof JSX.IntrinsicElements
? 'className' extends keyof JSX.IntrinsicElements[T]
export type AcceptsClassName<T> = T extends keyof React.JSX.IntrinsicElements
? 'className' extends keyof React.JSX.IntrinsicElements[T]
? T
: ClassNameMessage
: T extends React.ComponentType<infer P>
Expand All @@ -34,7 +34,7 @@ export declare namespace RestyleJSX {
export type IntrinsicClassAttributes<T> =
React.JSX.IntrinsicClassAttributes<T>
export type IntrinsicElements = {
[K in keyof JSX.IntrinsicElements]: React.JSX.IntrinsicElements[K] & {
[K in keyof React.JSX.IntrinsicElements]: React.JSX.IntrinsicElements[K] & {
css?: CSSObject
}
}
Expand Down