linaria icon indicating copy to clipboard operation
linaria copied to clipboard

Styled tags require type parameter in typescript

Open kcover opened this issue 2 years ago • 1 comments

Environment

typescript @linaria/[email protected]

  • Linaria version:
  • Bundler (+ version):
  • Node.js version:
  • OS:

Description

This commit made it so that typescript throws an error when props are passed to a linaria component without a type parameter also being provided. I might not call this a bug since people likely should have to specify the props their linaria components accept, but I think it should've been introduced in a major version release, along with some documentation. Thoughts on this? I'd be happy to put up a PR to rollback on the 4.x branch and add documentation if others agree. Looks like there is no 4.x branch so I would create that as well if I can.

Reproducible Demo

see the dtslint file in https://github.com/callstack/linaria/commit/922f20d664bb07f07285734635e966ade77925ef

kcover avatar Feb 02 '23 00:02 kcover

An error is thrown only if a component doesn't have a className property. I don't think it is a breaking change since it reflects current behaviour where such a className-less component will not be styled.

Anber avatar Feb 06 '23 14:02 Anber