Typescript: Component is missing the following properties from type
Sid110307 opened this issue · comments
Bug report 🐞
Version & Environment
- Version of browser: Firefox 125
- Version of
geist-ui/core
: ^2.3.8 - Next.js project with React and Typescript
Expected Behavior
No typescript errors
Actual results (or Errors)
I got an error:
TS2739: Type { children: string; onClick: (_: MouseEvent<HTMLButtonElement, MouseEvent>) => void; }
is missing the following properties from type Pick<Props & NativeAttrs & RefAttributes<HTMLButtonElement> & ScaleProps, "title" | "color" | "translate" | ... 260 more ... | "key">
: placeholder, onPointerEnterCapture, onPointerLeaveCapture
My code:
import { Button } from "@geist-ui/core";
export default function Page() {
...
return (
<div>
<Button onClick={_ => console.log("Hello")}>Action</Button> // error shows here
</div>
)
}
Apparently props like placeholder
, onPointerEnterCapture
, and onPointerLeaveCapture
are made required, is this intentional?
Same error.
Same error.
// @ts-ignore
can be used to solve compilation errors temporarily.
Same error. And i don't want to use //@ts-ignore