This is what makes sense in my head, but I could not find any facts / articles to support this.
Essentially something like
render() {
return (
someBoolean && <div>Some Markup</div>
)
}
less effective than
render() {
return (
someBoolean && <SomeComponent />
)
}
where it SomeComponenthas the exact same markup as the previous example.
My reasoning is that the markup should be created with every re-rendering, it will take more memory, while the saved component SomeComponentwill be referenced in memory and will not be created at each re-rendering, rendering.
Is there somewhere in the reaction documents that explain this in more detail?
Or is this reasoning inaccurate?