上QQ阅读APP看书,第一时间看更新
There's more...
In our example, we created the Home.js file, and our component's name is Home.
All React component names should start with the first letter capitalized in both the file and the class name. To begin with, it might feel uncomfortable for you to see this, but this is the best practice in React.
Some of the main differences between JSX and HTML are the attributes names. You may have noticed that we are using className instead of class. This is the only special attribute name. Others that are two words separated by a dash need to be converted to camelCase, for example, onClick, srcSet, and tabIndex. The aria-* and data-* attributes still uses the same nomenclature (data-something and aria-label).