- Hands-On Design Patterns with React Native
- Mateusz Grzesiukiewicz
- 72字
- 2021-08-13 15:12:56
What about component inheritance?
"At Facebook, we use React in thousands of components, and we haven't found any use cases where we would recommend creating component inheritance hierarchies."
- React official documentation ( https://reactjs.org/docs/composition-vs-inheritance.html)
- React official documentation ( https://reactjs.org/docs/composition-vs-inheritance.html)
I have not come across a situation where I had to step away from component composition in favor of inheritance. Neither have developers at Facebook (as per the preceding quotation). Hence, I highly recommend you get used to composition.
推薦閱讀
- Vue.js設計與實現
- Boost程序庫完全開發指南:深入C++”準”標準庫(第5版)
- Raspberry Pi for Python Programmers Cookbook(Second Edition)
- 兩周自制腳本語言
- Mastering Natural Language Processing with Python
- 深入淺出WPF
- Wireshark Network Security
- 程序設計基礎教程:C語言
- RealSenseTM互動開發實戰
- Kotlin開發教程(全2冊)
- Java零基礎實戰
- Node.js 6.x Blueprints
- Offer來了:Java面試核心知識點精講(框架篇)
- C/C++代碼調試的藝術
- Bitcoin Essentials