eps1lon / types-react-codemod

Collection of transforms for jscodeshift related to `@types/react`
MIT License
309 stars 11 forks source link

If the original type is React.PropsWithChildren, using codemod will still add an extra PropsWithChildren #391

Closed MasonChow closed 5 months ago

MasonChow commented 5 months ago

version: types-react-codemod@3.3.0

-  React.FC<React.PropsWithChildren<Props>>
+  React.FC<React.PropsWithChildren<React.PropsWithChildren<Props>>>

image

eps1lon commented 5 months ago

We can do this for apparent nestings but we'd still miss

type Props = React.PropsWithChildren<...>
const Component: React.FC<Props>

and apply a redundant PropsWithChildren.

I don't consider this a bug since the behavior is still the same. Contributions are appreciated.

MasonChow commented 5 months ago

okok