Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: typeof on a styled component returns incompatible type #4305

Open
samettttt opened this issue May 7, 2024 · 1 comment
Open

Comments

@samettttt
Copy link

samettttt commented May 7, 2024

Environment

System:

  • OS: macOS 14.4.1
  • CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
  • Memory: 1.01 GB / 32.00 GB
  • Shell: 5.9 - /bin/zsh

Binaries:

  • Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
  • Yarn: 3.8.1 - ~/.nvm/versions/node/v20.12.2/bin/yarn
  • npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm

Reproduction

https://stackblitz.com/edit/rtl-template-s7ja9r?file=package.json,src%2FApp.test.tsx

Steps to reproduce

import styled from 'styled-components';

const One = styled.div``;
const Two = styled(One)``;

const foo = (component: typeof One) => {
  // do something
};

foo(Two);

Expected Behavior

No type error.

Actual Behavior

Screenshot 2024-05-07 at 11 18 02
@samettttt samettttt changed the title Regression when using typeof on a styled component Regression: typeof on a styled component returns incompatible type May 7, 2024
@samettttt
Copy link
Author

Still doesn't work using styled-components: 6.1.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant