Why does the below react work? As the function name in Hello.js component is Hello but it was not mentioned in main component that imported the Hello.js , Is it a property of arrow function-(if i use normal function instead of arrow function the programme show error.)
The Hello.js component :
import React from 'react';
const Hello =() => <h1> HELLO <h1/>
export default Hello
Where Hello.js component got exported/ been Called.
import React from 'react';
import MyComponent from './Hello'
class App extends React.Component{
render(){
return(
<div>
<MyComponent />
<div/>
);
}
}