本地反应只是查看,但你可以尝试建立你的 的 MVC 强> 架构,但你的控制器仍然有一个渲染功能,你必须声明这个方法,但你 可以在视图中构建组件并在控制器内部调用它们 尝试将组件控件保存在控制器中。 例如,如果您有一个视图组件,并且此组件具有特定的提交按钮 你可以将你的组件作为控制器内部的视图调用,但是当按下按钮时 控制器内部的方法,控制器使用模型处理提交按钮 功能。您可以使用 的 我的MVC架构 强> 这里 : https://github.com/ziaadini/react-native-for-yii-developers
是。 React Native只是你提到的那些软件设计模式中的“V”。如果你考虑React周围的其他库,比如Flux,那么 也许 我的答案不是100%准确。我建议读这个:
https://medium.com/javascript-inside/what-if-react-was-really-only-the-v-in-mvc-5854fd6f601c
这是一个更完整的答案,考虑到App不仅仅是React Native,还有后端和涉及的数据模型:
https://medium.com/of-all-things-tech-progress/understanding-mvc-architecture-with-react-6cd38e91fefd
希望能帮助到你。
最好的方法是使用Redux或Relay Architecture