Why components in react are single closed tags

clipboard.png

import React, {Component} from "react"
import". / App.scss"
import NavBar from". / components/NavBar/NavBar"

export default class App extends Component {
render () {

return (
  <div className="App">
    <header className="App-header">
      <h1 className="App-title">Listen Music</h1>
    </header>
    <NavBar />
  </div>
)

}
}

where < NavBar/ > is not written as < NavBar > < NavBar/ >

Mar.16,2021

if the tag doesn't need to wrap anything else, it can be written like this. The common thing is input :

   

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36e80-2ad96.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36e80-2ad96.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?