Skip to content

TS doesn't see props after «styled()» of «withTheme(styled.button... #893

@Opty1712

Description

@Opty1712

Linking with callstack/react-theme-provider#130

Environment

  • macOS Monterrey
  • yarn 3 (PnP)
  • TS 4.5.2
  • "@linaria/core": "^3.0.0-beta.15",
  • "@linaria/react": "^3.0.0-beta.15",
  • "@linaria/babel-preset": "^3.0.0-beta.15",
  • "@linaria/shaker": "^3.0.0-beta.15",
  • "@linaria/webpack-loader": "^3.0.0-beta.16",
  • "@callstack/react-theme-provider": "^3.0.7",
  • bundler - storybook@6
  • node 14.17.6

Description

export const Select = () => (
	<OptionButton type="button" data-qa-id="listItem-btn" />
);

const Button = withTheme(styled.button<Theme>`
	width: 100%;
`);

export const OptionButton = styled(Button)`
	width: 50%;
`;

image

image

If I add Button directly - no error
image

If I remove withTheme - no error too
image

Reproducible Demo

https://codesandbox.io/s/wild-grass-g4e0u?file=/src/App.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions