Practice
If you render your component using JSX, the name of that component must start with a capital letter, otherwise React will throw an error about an unrecognised tag. The convention is that only HTML elements and SVG tags may start with a lowercase letter.
class SomeComponent extends Component {
// Code goes here
}
You can define a component class whose name starts with a lowercase letter, but when you import it, it must be capitalised. Lowercase is fine here:
class myComponent extends Component {
render() {
return <div />
}
}
export default myComponent
When importing it into another file, it must start with a capital letter:
import MyComponent from './MyComponent'
Comments