From 8bdb9ed3c2fa2655b9fa53b2db2911d5702e38b3 Mon Sep 17 00:00:00 2001 From: axmmisaka <6500159+axmmisaka@users.noreply.github.com> Date: Sun, 3 Dec 2023 06:16:45 -0800 Subject: [PATCH 1/2] Add title prop for imported inline SVG React components This would make TypeScript server stop complaining should one decide to use the "title" prop Relate issue: https://github.com/facebook/docusaurus/issues/9609 --- packages/docusaurus-module-type-aliases/src/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docusaurus-module-type-aliases/src/index.d.ts b/packages/docusaurus-module-type-aliases/src/index.d.ts index 09c3f2fb3d59..a453aac5bf52 100644 --- a/packages/docusaurus-module-type-aliases/src/index.d.ts +++ b/packages/docusaurus-module-type-aliases/src/index.d.ts @@ -356,7 +356,7 @@ declare module '@docusaurus/useGlobalData' { declare module '*.svg' { import type {ComponentType, SVGProps} from 'react'; - const ReactComponent: ComponentType>; + const ReactComponent: ComponentType & {title?: string}>; export default ReactComponent; } From 1d155bf4b3705d59cfec7de56d660df3dc90e3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Tue, 5 Dec 2023 17:17:49 +0100 Subject: [PATCH 2/2] Update packages/docusaurus-module-type-aliases/src/index.d.ts --- packages/docusaurus-module-type-aliases/src/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-module-type-aliases/src/index.d.ts b/packages/docusaurus-module-type-aliases/src/index.d.ts index a453aac5bf52..1f0e7679420a 100644 --- a/packages/docusaurus-module-type-aliases/src/index.d.ts +++ b/packages/docusaurus-module-type-aliases/src/index.d.ts @@ -356,7 +356,9 @@ declare module '@docusaurus/useGlobalData' { declare module '*.svg' { import type {ComponentType, SVGProps} from 'react'; - const ReactComponent: ComponentType & {title?: string}>; + const ReactComponent: ComponentType< + SVGProps & {title?: string} + >; export default ReactComponent; }