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

Property 'checked' does not exist on type 'EventTarget & Element' #33

Open
SudheerAtomLeap opened this issue Dec 13, 2020 · 0 comments
Open

Comments

@SudheerAtomLeap
Copy link

SudheerAtomLeap commented Dec 13, 2020

Description
Below code results in typescript prompt Property 'checked' does not exist on type 'EventTarget & Element' error for onToggle event.

  <Toggle
    name="toggle-1"
    onToggle={(e) => console.log(e.target.checked)}
  />

Version
React-toggle-component version : ^3.0.8
Typescript version: ^4.0.2

Expected behavior
checked should be present in e.target property, similar to React.ChangeEvent<HTMLInputElement>

P.S.: Found out that styled-components is not listed as a peer-dependency and results in an error on adding this awesome library to my project. It should be mentioned in the installation instructions or add styled-components sub-dependency while installing react-toggle-component.

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

1 participant