简体   繁体   English

在 JSX 中调用组件和将它们作为子属性传递有什么区别?

[英]What is the difference between calling components in JSX and passing them as children props?

So I was navigating on web, and I saw a senior developer talking about that most of junior developers don't know the difference between calling components in JSX and passing them as children props.所以我在 web 上导航,我看到一位高级开发人员在谈论大多数初级开发人员不知道在JSX 中调用组件和将它们作为子属性传递之间的区别。 And honestly I don't know the difference.老实说,我不知道有什么区别。 Can any one tell me the difference between them, is it performance, is it the architecture...任何人都可以告诉我它们之间的区别,是性能,还是架构......

Thank you.谢谢你。

So according to the information I got I think the best information on the topic is found here here and here .因此,根据我获得的信息,我认为有关该主题的最佳信息可以在此处此处找到

Main difference is probably the scope in which the components are declared, so you can declare click handlers in a different way.主要区别可能是声明组件的 scope,因此您可以用不同的方式声明点击处理程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM