|
|
|
|
|
by allover
3227 days ago
|
|
Whilst you're correct, that's where the names are from, it's also not totally accurate to suggest it has nothing to do with React. React defines `React.createElement`, `<div class="foo"/>` transforms to `React.createElement("div", { "class": "foo" })`, so React could convert that under the hood to set className correctly. Preact does something similar to allow this. However it now seems it is now too late for React for too little benefit. And there's a downside [1]: > The JSX transform used to do that, but we don't recommend it because it's confusing if you ever try to pass class= or for= as a prop to your own components – you wouldn't expect to access them with a different name. [1] https://github.com/facebook/react/issues/4433#issuecomment-1... |
|