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

Checkbox Event Type Error #205

Open
GeekEast opened this issue Nov 21, 2020 · 1 comment
Open

Checkbox Event Type Error #205

GeekEast opened this issue Nov 21, 2020 · 1 comment

Comments

@GeekEast
Copy link

Issue

  • happens in e.target.checked: Property 'checked' does not exist on type 'EventTarget'.
<Checkbox checked={x} onChange={(e) => setX(e.target.checked)} />

Suggestion

  • in index.d.ts
export interface Props {
  onChange?: (e: Event) => void;
}
  • to sth like following
interface Target extends Props {
  checked: boolean;
}

interface ChangeEvent {
  target: Target;
  stopPropagation: () => void;
  preventDefault: () => void;
  nativeEvent: Object;
}

export interface Props {
  onChange?: (e: ChangeEvent) => void;
}
@wangxingkang
Copy link
Contributor

@GeekEast ac34c5d

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

2 participants