Skip to content

Commit

Permalink
Update: excluding declared props from inferred props in type declarat…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
stevematney committed May 4, 2023
1 parent ec5e8ae commit 978cc6d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ function updateLoadingButton(componentName, fileName) {
}

const getPropsDeclaration = typeToInfer =>
`React.PropsWithChildren<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & InferProps<typeof ${typeToInfer}>>`;
`React.PropsWithChildren<
Omit<
React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>,
keyof InferProps<typeof ${typeToInfer}>
> & InferProps<typeof ${typeToInfer}>
>`;

function replaceTypeFile(componentName, typeFilePath) {
const fileText = fs.readFileSync(typeFilePath, 'utf8');
Expand Down

0 comments on commit 978cc6d

Please sign in to comment.