MathiasGilson / Tailwind-Styled-Component

Create Tailwind CSS React components like styled components with class names on multiple lines and conditional class rendering

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Component type error

YeungKC opened this issue · comments

image

I think it is TailwindComponent? but it is any.

To expound on this report, the specific error I am seeing that was introduced in version 2.1.7 is:

error TS7031: Binding element '$xxx' implicitly has an 'any' type.

or more specifically, tw is typed as any due to templateFunctionFactory being typed as any here.

I also found out later that this should not be changed to any, otherwise it would be anyscript.

@MathiasGilson Could you help with this issue?

Any option to fix it?

I solved it by downgrading to 2.1.6

"resolutions": {
    "tailwind-styled-components": "2.1.6"
}

Note: resolutions only work with yarn, you have to use overrides with npm

Any fix planned on this issue?

Any solution?

Just published the version 2.2.0 that should address this issue

I've got a warning for excessively deep type instanciation though, and I'm not sure how to fix that
If some of you guys are typescript experts and could have a look at PR #71 it would be greatly appreciated!