Looking at html, there is a bunch of built-in attributes on tags:
I am trying to work out what HTML "on spec" attributes are named.
Note: I am not looking for an opinion - I want to determine/breakdown exactly what the W3C opinion is. This is so I can recreate it this naming convention in React.
As a best-guess, I generally stick to the phrase:
The thing [is/has x]
And is/hasX
becomes my prop.
However, I do not have a good grasp of the lingo of grammar, and it can be difficult for me to keep it consistent.
Lets consider two inputs, one html and one React.
This sounds right to me:
My input is hovered
<input checked selected active disabled />
<MyInput isHovered hasTooltip hasError />
But isHovering
also sounds correct , but I suspect this doesn't have the correct (past) tense:
My input is hovering
<input activating checking />
<MyInput isHovering hasTooltip isErroring />
When things start to get confusing, I realise I'm in the bad habit of trying to side-step doing the grammatical-gymnastics
My input is...hover
<Myinput isHover hasError />
But the props of the component no longer seem consistent. Plus its not what html does:
<input check />
Question What is the correct (verb?) tense of html attributes according to the spec (I've looked, and didn't find anything in the spec about tense/verbs)?
Note: is/has
is added because props, unlike attributes are variables, and this prefix helps with code clarity