You are missing an important step, transpiling your code into something readable. JSX is just syntactic sugar on top of React for .createElement
and is not usable without a compilation step.
The short answer is that unless you have a specific reason for trying to do this (e.g., you're trying to learn/understand), I would suggest you use an out of the box tool such as NextJS or create-react-app as they will give you a production ready solution. Alternatively, look at using React without JSX. I'm guessing you were trying to do something like what is mentioned in this question: ReactJS: "Uncaught SyntaxError: Unexpected token <". However, you haven't provided enough context for us to help with that or your motivation for doing so.
Diving a bit more into the details, your compilation tool (e.g., babel) will take JSX and compile it into code that plain JS can understand.
const HelloWorld = ({name}) => <div>Hello {name}</div>
const MyCoolElement = () => <HelloWorld name='Bob' />
ReactDOM.render(<MyCoolElement>, document.getElementById('root));
becomes something like:
const HelloWorld = ({name}) => React.createElement('div', null, `Hello ${name}`);
const MyCoolElement = () => React.createElement(HelloWorld, {name:'Bob'}, null);
ReactDOM.render(React.createElement(MyCoolElement, {}, null), document.getElementById('root));