可以直接使用React.createElement(component, props, …children) 来代替JSX
class Hello extends React.Component {
render() {
return React.createElement('div', null, `Hello ${this.props.toWhat}`);
}
}
root.render(
<React.StrictMode>
<BrowserRouter>
<Hello toWhat="amadeus" />
</BrowserRouter>
</React.StrictMode>
);