📌  相关文章
📜  React.createElement - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:14.460000             🧑  作者: Mango

代码示例1
class Hello extends React.Component {
  render() {
    return React.createElement('div', null, `Hello ${this.props.toWhat}`);
  }
}

ReactDOM.render(
  React.createElement(Hello, {toWhat: 'World'}, null),
  document.getElementById('root')
);