GithubHelp home page GithubHelp logo

Comments (5)

marvinhagemeister avatar marvinhagemeister commented on May 22, 2024 1

Are you saying that JSX should be using all lowercase instead, and the definitions in jsx.d.ts don't really matter?

No, I was just giving historical context. We should support lowercased events like they are specced in web standards + camelCase. Might just be a matter of updating the type definitions in our JSX types.

from preact.

marvinhagemeister avatar marvinhagemeister commented on May 22, 2024

FYI: Preact supports all lowercase event name to align with the web. I think the Capture suffix is because of a check in our source for capture events that's case sensitive. Might make sense to loosen that restriction. Off the top of my head I'm not sure if we support camelcasing them all natively or only in compat. Something worth to check.

from preact.

CodingDoug avatar CodingDoug commented on May 22, 2024

@marvinhagemeister VSCode gives me an uncomfortable error if the JSX attribute doesn't match exactly. For example:

Type '{ children: Element[]; id: string; class: string; onFocusin: undefined; }' is not assignable to type 'HTMLAttributes'.
Property 'onFocusin' does not exist on type 'HTMLAttributes'. Did you mean 'onfocusin'? ts(2322)

from preact.

marvinhagemeister avatar marvinhagemeister commented on May 22, 2024

Yeah onFocusin is something we'll never support. In your original message you wrote onFocusIn (note the uppercase letter I). Where is this new form of casing coming from?

from preact.

CodingDoug avatar CodingDoug commented on May 22, 2024

In my original message, I suggested that the definitions for these event attributes are incorrectly cased compared to the rest of the event attributes (scan the entire list in the file I cited - every single one of them is camel cased except for four of the focus events). I suggested alternatives that would bring them into consistency.

I think I may have been unclear after that - I'm not saying that I want to use onFocusin. I want to use camel cased attributes as they are defined in jsx.d.ts. Are you saying that JSX should be using all lowercase instead, and the definitions in jsx.d.ts don't really matter?

from preact.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.