Skip to content

Commit

Permalink
fix: don't expand the original React.ElementType type
Browse files Browse the repository at this point in the history
  • Loading branch information
tkajtoch committed May 28, 2024
1 parent bea84c0 commit 0fb9c23
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/eui/scripts/dtsgenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<any, keyof React.JSX.IntrinsicElements>
generator.then(() => {
const defsFilePath = path.resolve(baseDir, 'eui.d.ts');

Expand Down Expand Up @@ -155,6 +156,10 @@ generator.then(() => {
}
) // end 3.
.replace(/$/, `\n\n${buildEuiTokensObject()}`) // 4.
.replaceAll(
'React.ElementType<any, keyof React.JSX.IntrinsicElements>',
'React.ElementType'
) // 5.
);
});

Expand Down

0 comments on commit 0fb9c23

Please sign in to comment.