New error: Type of property 'defaultProps' circularly references itself in mapped type
See original GitHub issuepackages/connected-components/src/header-editor/styled.ts:24:34 - error TS2615: Type of property 'defaultProps' circularly references itself in mapped type 'Pick<ForwardRefExoticComponent<Pick<Pick<any, Exclude<keyof ReactDefaultizedProps<StyledComponentInnerComponent<WithC>, ComponentPropsWithRef<StyledComponentInnerComponent<WithC>>>, StyledComponentInnerAttrs<...> | ... 1 more ... | StyledComponentInnerAttrs<...>> | Exclude<...> | Exclude<...> | Exclude<...>> & Parti...'.
24 export const EditableAuthorTag = styled(AuthorTag)`
~~~~~~~~~~~~~~~~~
Also, Iβm seeing each of these errors printed twice.
To repro:
yarntsc -b -f
Note that it fails with a different (apparently unrelated) error in 3.8.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:48
- Comments:23
Top Results From Across the Web
Disable waring 'Type of property circularly references itself in ...
So here the issue with js and vscode. If i say data type is /** @param {A} [data] */ the error are from...
Read more >Disable Waring 'Type Of Property Circularly References Itself ...
In JavaScript it is a runtime error to use a nonobject type on the right side of the in operator. TypeScript 4.2 ensures...
Read more >Type of property 'defaultProps' circularly references ... - Doriri
Props μ λ¬μλ μ΄μμ΄ μμκ³ μ΄λ€ μ€λ₯μΈκ° μΆμ΄μ κ²μν΄λ΄€λ€. Type of property 'defaultProps' circularly references itself in mapped type.
Read more >Type of property 'defaultProps' circularly references itself in ...
Type of property 'defaultProps' circularly references itself in mapped type 'Pick<ForwardRefExoticComponent<Pick<Pick<any, Exclude&Β ...
Read more >Type of property 'defaultProps' circularly ... - Code Grepper
Type of property 'defaultProps' circularly references itself in mapped type 'Pick<ForwardRefExoticComponent<Pick<Pick<any, Exclude<keyof.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Not sure if that applies for all of us, but it seems that this error appears using
typescript@^3.9.0(particularly after this PR https://github.com/microsoft/TypeScript/pull/36696).This breaking change was mitigated by updating
@types/styled-componentshttps://github.com/DefinitelyTyped/DefinitelyTyped/pull/42619However, this fix was deployed at
v5.0.1of@types/styled-componentswhich coversstyled-components@^5.0.0but, nothing has been deployed for earlier versions (e.g. what would coverstyled-components@^4.0.0)So if you are using
styled-components@^5.0.0simply runif you are using
styled-components@^4.0.0, well then it is more difficult for now, as in essence@types/styled-componentsshould be updated.However, as a temporary fix it is possible to remove
@types/styled-componentsfrom the project, copystyled-components.d.tsfile from@types/styled-components@^4.0.0to your project and make the same fix as in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42619 e.g.:example content of styled-components.d.ts
and sorry that Iβm posting this still on TypeScript repository, where it seems that DefinitelyTyped repository would be a better fit for this issue π
Try to use