📜  在 react js 组件中使用它 - Javascript 代码示例

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

代码示例1
class MyName extends React.Component {
    // name property goes here:
get name() {
  return 'Anthony';
}

  render() {
    return 

My name is {this.name}.

; } } ReactDOM.render(, document.getElementById('app'));