Skip to content

Commit

Permalink
Require TS 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Dec 14, 2024
1 parent 9b62fd2 commit ab928db
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 27 deletions.
2 changes: 1 addition & 1 deletion packages/react/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// TypeScript Version: 5.0
// TypeScript Version: 5.1
export * from '..'
24 changes: 0 additions & 24 deletions packages/react/types/tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,30 +198,6 @@ const anim1 = keyframes`
/>
}

{
// based on the code from @types/react@17.x
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/98fa4486aefd5a1916aa385402467a7157e3c73f/types/react/v17/index.d.ts#L540-L548
type OldFC<P = {}> = OldFunctionComponent<P>
interface OldFunctionComponent<P = {}> {
(
props: React.PropsWithChildren<P>,
context?: any
): React.ReactElement<any, any> | null
propTypes?: React.WeakValidationMap<P> | undefined
contextTypes?: React.ValidationMap<any> | undefined
defaultProps?: Partial<P> | undefined
displayName?: string | undefined
}
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/40993
// this is really problematic behaviour by @types/react@<18 IMO
// but it's what @types/react did so let's not break it.
const CompWithImplicitChildren: OldFC = () => null
;<CompWithImplicitChildren>
content
<div />
</CompWithImplicitChildren>
}

// Tests for WithConditionalCSSProp
{
const WithOptionalClassName = (props: { className?: string }) => null
Expand Down
2 changes: 1 addition & 1 deletion packages/styled/types/base.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// TypeScript Version: 5.0
// TypeScript Version: 5.1
export * from '../base'
2 changes: 1 addition & 1 deletion packages/styled/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// TypeScript Version: 5.0
// TypeScript Version: 5.1
export * from '..'

0 comments on commit ab928db

Please sign in to comment.