-
-
Notifications
You must be signed in to change notification settings - Fork 2k
type check doesn't run for styled-components #3515
Description
- Check if updating to the latest Preact version resolves the issue
Describe the bug
before starting, i'm honestly not sure if this's a bug or it's me doing something wrong, especially about typescript settings with preact, so i want you to check the configure in the repro code below first.
hi, i found tsc somehow didn't return a type error that i expected for components using styled-components in my private preact project.
it checks non-styled components properly and returns a result as intended, also the issue doesn't happen in a react project with the same source (though the settings are kinda different as you see in my repro code).
i know preact isn't 100% compatible with react in typing as well, so am kinda reckoning it causes the problem but haven't dug down preact's .d.ts and else.
To Reproduce
here's the repro code: miyacoz/preact-styled-repro
please note there're master branch with preact where the problem is happening, and react branch with react where everything's fine (= tsc properly emitting type errors).
Steps to reproduce the behavior:
- clone the repro code
yarn startthen tsc starts- confirm tsc doesn't point out
<Styled>having an error
also compare the result with react one (don't forget yarn install after checking out).
Expected behavior
tsc properly reports type errors.
in my repro code, it points out type errors with both <Styled> and <Component>.