<script type="text/babel">
const rootElement = document.getElementById("root");
const Element = (firstName, lastName) => {
<div>
Hello, {firstName} {lastName}
</div>;
};
<Element firstName="John" lastName="Doe" />;
ReactDOM.render(Element, rootElement);
</script>
Functions are not valid as a React child. This may happen if you return a Component instead of from render. Or maybe you meant to call this function rather than return it.