我们上一节封装了一个按钮,这一节我们继续理解封装的概念和了解封装组件需要注意的事项 首先我们回顾上一篇最后的代码,代码如下 const Button = ({color,text}) =>{ return { type: 'button', props: { className: `btn btn - $ { color }`, children: { type: 'em', props: { children: text, }, }, }, }; } 我们最终调用的形式如下所示 Button({color:…