React can render children of many types. In most cases it’s either an array or a string.
String
function render() {
return (
<div>
Hello World!
</div>
)
}
Array
function render() {
return (
<div>
{["Hello ", <span>World</span>, "!"]}
</div>
)
}
Functions may be used as children. However, it requires coordination with the parent component to be useful.
function render() {
return (
<div>
{ () => "hello world!" }
</div>
)
}