Skip to content

Commit acf65f9

Browse files
authored
Fix TS type conflict for <img> tag (#28672)
This type was added in PR #28269 but doesn't need to be public and was causing conflicts with `@types/react@17`. We currently use `@types/react@16` so ideally we should upgrade to `@types/react@17` and then remove the `ts-ignore`. Fixes #28647
1 parent f6d8a11 commit acf65f9

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

packages/next/client/image.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ export default function Image({
627627
data-nimg={layout}
628628
style={imgStyle}
629629
className={className}
630+
// @ts-ignore - TODO: upgrade to `@types/react@17`
630631
loading={loading || 'lazy'}
631632
/>
632633
</noscript>

packages/next/types/index.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ declare module 'react' {
4040
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
4141
nonce?: string
4242
}
43-
44-
// <img loading="lazy"> support
45-
interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
46-
loading?: 'auto' | 'eager' | 'lazy'
47-
}
4843
}
4944

5045
export type Redirect =

0 commit comments

Comments
 (0)