📌  相关文章
📜  在反应中传递道具 - Javascript 代码示例

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

代码示例1
/* PASSING THE PROPS to the 'Greeting' component */
const expression = 'Happy';
 // statement and expression are the props (ie. arguments) we are passing to Greeting component

/* USING THE PROPS in the child component */
class Greeting extends Component {
  render() {
    return 

{this.props.statement} I am feeling {this.props.expression} today!

; } }