Say I have a functional component:
const Foo = (props) => ( <div>{props.name}</div> );
What is the difference between calling it as a function:
const fooParent = () => (
<div> {Foo({ name: "foo" })} </div>
)
against calling it as a component:
const fooParent = () => (
<div> <Foo name="foo"/> </div>
)
I am mostly interested in the performance implications, how React views them differently inside, and maybe how things can be different in React Fiber, where I heard that functional components got a performance boost.
source
share