Environment
- Linaria version: 6.2
- Node.js version: 18.19.0
- OS: MacOS 14.5
"next-with-linaria": "^0.7.0"
Description
I'm migrating from Styled-Components to Linaria. So far pretty great! However I think I've found a minor typing issue.
I have a Button component that I frequently use as an anchor tag thusly…
<Button onClick={doSomething} >This is rendered as a button tag</Button>
<Button as="a" href="/" >This is rendered as an anchor tag</Button>
I was pleased to see that this basically works — the browser does correctly render an <a> tag in the markup, the link functions, cool. However, Typescript complains about the href attribute. The type of the component is still returned as StyledComponent<ClassAttributes<HTMLButtonElement> & ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>
Environment
"next-with-linaria": "^0.7.0"Description
I'm migrating from Styled-Components to Linaria. So far pretty great! However I think I've found a minor typing issue.
I have a Button component that I frequently use as an anchor tag thusly…
I was pleased to see that this basically works — the browser does correctly render an
<a>tag in the markup, the link functions, cool. However, Typescript complains about thehrefattribute. The type of the component is still returned asStyledComponent<ClassAttributes<HTMLButtonElement> & ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>