React 5

组件可以接受任意 props,包括基本数据类型React 元素以及函数

因为 Props 可以接受 React 元素,React 组件之间就会有各种 组合包含 的可能。

  • children prop 来传递子组件

  • 自定义prop 来传递组件

  •  当参数传递

上面3种形式,可以组合着用

原文地址:https://www.cnblogs.com/crdanding/p/12120403.html