File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @linaria/react " : patch
3+ ---
4+
5+ Fix ` styled.<tag> ` typings in environments where only the React JSX runtime types are available (e.g. ` jsx: react-jsx ` ).
Original file line number Diff line number Diff line change @@ -116,16 +116,16 @@ declare global {
116116
117117let idx = 0 ;
118118
119- // eslint-disable-next-line @typescript-eslint/consistent-type-imports
120- type ReactIntrinsicElements = typeof import ( 'react' ) extends {
121- JSX : { IntrinsicElements : infer T } ;
119+ type GlobalJSXIntrinsicElements = JSX . IntrinsicElements ;
120+
121+ declare module 'react' {
122+ // eslint-disable-next-line @typescript-eslint/no-namespace
123+ namespace JSX {
124+ interface IntrinsicElements extends GlobalJSXIntrinsicElements { }
125+ }
122126}
123- ? T
124- : never ;
125127
126- type IntrinsicElements = [ ReactIntrinsicElements ] extends [ never ]
127- ? JSX . IntrinsicElements
128- : ReactIntrinsicElements ;
128+ type IntrinsicElements = React . JSX . IntrinsicElements ;
129129
130130// Components with props are not allowed
131131function styled (
You can’t perform that action at this time.
0 commit comments