From 7397ff42b0bffef1d1d5a81d3b1f4d9c484972e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=BCller?= Date: Wed, 1 Jul 2020 00:38:27 +0200 Subject: [PATCH] fix(image): adjust image types for lazy loading --- libs/ui/@types/image.d.ts | 7 +++++++ libs/ui/src/lib/image/image.tsx | 6 ------ libs/ui/tsconfig.json | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 libs/ui/@types/image.d.ts diff --git a/libs/ui/@types/image.d.ts b/libs/ui/@types/image.d.ts new file mode 100644 index 0000000..be92007 --- /dev/null +++ b/libs/ui/@types/image.d.ts @@ -0,0 +1,7 @@ +import 'react' + +declare module 'react' { + interface ImgHTMLAttributes extends HTMLAttributes { + loading?: 'lazy' | 'eager' | 'auto'; + } +} \ No newline at end of file diff --git a/libs/ui/src/lib/image/image.tsx b/libs/ui/src/lib/image/image.tsx index 5069d55..6336b47 100644 --- a/libs/ui/src/lib/image/image.tsx +++ b/libs/ui/src/lib/image/image.tsx @@ -9,12 +9,6 @@ export interface ImageProps { option?: string } -declare module "react" { - interface ImgHTMLAttributes extends HTMLAttributes { - loading?: "auto" | "eager" | "lazy"; - } -} - export const Image = (props: ImageProps) => { const [character, setCharacter] = useContext(AppContext); diff --git a/libs/ui/tsconfig.json b/libs/ui/tsconfig.json index fa0186d..ca5ec52 100644 --- a/libs/ui/tsconfig.json +++ b/libs/ui/tsconfig.json @@ -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",