Skip to content

Commit

Permalink
fix(image): adjust image types for lazy loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerd Müller committed Jun 30, 2020
1 parent 6723fee commit 7397ff4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 7 additions & 0 deletions libs/ui/@types/image.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'react'

declare module 'react' {
interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
loading?: 'lazy' | 'eager' | 'auto';
}
}
6 changes: 0 additions & 6 deletions libs/ui/src/lib/image/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ export interface ImageProps {
option?: string
}

declare module "react" {
interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
loading?: "auto" | "eager" | "lazy";
}
}

export const Image = (props: ImageProps) => {
const [character, setCharacter] = useContext(AppContext);

Expand Down
2 changes: 1 addition & 1 deletion libs/ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"types": ["node", "jest"]
"types": ["node", "jest", "@types/**"]
},
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
Expand Down

0 comments on commit 7397ff4

Please sign in to comment.