From 0fb9c23f05959f074f313b6b0f99bc29f977eca8 Mon Sep 17 00:00:00 2001 From: Tomasz Kajtoch Date: Tue, 28 May 2024 12:34:26 +0200 Subject: [PATCH] fix: don't expand the original `React.ElementType` type --- packages/eui/scripts/dtsgenerator.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/eui/scripts/dtsgenerator.js b/packages/eui/scripts/dtsgenerator.js index b973005e67c..f8eacd8f665 100644 --- a/packages/eui/scripts/dtsgenerator.js +++ b/packages/eui/scripts/dtsgenerator.js @@ -106,6 +106,7 @@ const generator = dtsGenerator({ // 2. replace any import("src/...") declarations to import("@elastic/eui/src/...") // 3. replace any import("./...") declarations to import("@elastic/eui/src/...) // 4. generate & add EuiTokenObject +// 5. Fix React.ElementType being incorrectly expanded to React.ElementType generator.then(() => { const defsFilePath = path.resolve(baseDir, 'eui.d.ts'); @@ -155,6 +156,10 @@ generator.then(() => { } ) // end 3. .replace(/$/, `\n\n${buildEuiTokensObject()}`) // 4. + .replaceAll( + 'React.ElementType', + 'React.ElementType' + ) // 5. ); });