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

Event handler conventions and prop clashes #19

Open
ChristophP opened this issue Jun 22, 2017 · 2 comments
Open

Event handler conventions and prop clashes #19

ChristophP opened this issue Jun 22, 2017 · 2 comments

Comments

@ChristophP
Copy link
Owner

ChristophP commented Jun 22, 2017

  1. Investigate how event handlers behave when passing event types that aren't lowercase..
    Right now we call event handlers like this:
    c.addEventListener('onClickButton', function(e) {
      console.log('Event `onClickButton` triggered', e)
    });

that's not very nice because usually there shouldn't be an on in the first param of addEventListener.
https://developer.mozilla.org/de/docs/Web/API/EventTarget/addEventListener

  1. We should check if props already exist when adding getters and setters, instead of overwriting them.
@layflags
Copy link
Collaborator

  1. I thought about this too, but what if you don't prefix your handlers with on in React? We should avoid too much magic. You just use it like you defined it.
  2. We should!

@ChristophP
Copy link
Owner Author

Agreed let's drop point one.

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