You get a bonus - 1 coin for daily activity. Now you have 1 coin

Why must component names start with a capital letter? in REACT

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:

  1. import MyComponent from './MyComponent'
  2.  

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Scripting client side JavaScript, jqvery, BackBone"

Terms: Scripting client side JavaScript, jqvery, BackBone