Your problem is not related to typescript. In middleware/renderer.js you wrote:

const html = ReactDOMServer.renderToString(React.createElement(<App />));

This is incorrect. Change it to:

const html = ReactDOMServer.renderToString(React.createElement(App));

And you're good to go.

You should read the error message. It's already told you what is going wrong. Also learn more about the React concepts, especially the difference between "JSX Element" and "JSX Component".

Related Query