Can someone explain the difference in calling a JSX Element as component and as function in react?
These are my functions.
Case-1: as a function
const MyFunction = () => {
return (
<div>Hello</div>
)
}
and calling it as
<Parent>
MyFunction()
</Parent>
Case-2: as a react functional component
const MyFunction:React.FC = ():JSX.Element => {
return (
<div>Hello</div>
)
}
and calling it as
<Parent>
<MyFunction />
</Parent>
can someone please explain, if there really is a difference or not?