In React 16, unknown element props are now set as attributes: https://facebook.github.io/react/blog/2017/09/08/dom-attributes-in-react-16.html … But how do you set a property on an element?
-
Show this thread
-
Replying to @tomdale
So class={foo} works now? If so, should people transition to it?
1 reply 0 retweets 0 likes -
It works but always warns (and we encourage people to treat warnings as errors). Maybe someday.
1 reply 0 retweets 3 likes -
Replying to @dan_abramov @tomdale
What's the rationale for making class= an error but letting other attributes work?
1 reply 0 retweets 0 likes -
If there exists a "canonical" React name then we prefer you use it. This makes custom components accepting DOM props have more JS-y APIs.
1 reply 0 retweets 1 like -
class/className is not the only one working this way. Same story for tabindex/tabIndex or arabic-form/arabicForm.
1 reply 0 retweets 1 like
Replying to @dan_abramov @tomdale
Similar: maxLength, there's a bunch. I'll be watching with interest to see whether this improves things!
11:21 AM - 22 Sep 2017
0 replies
0 retweets
2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.