如果 React.js 是 V,那么在 MVC 中,其他字母是什么? [英] If React.js is the V, in the MVC, what are the other letters?

查看:28
本文介绍了如果 React.js 是 V,那么在 MVC 中,其他字母是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习 React,但我仍然不确定如何将其发展为成熟的应用.

I'm learning React but I'm still unsure on how to grow it up into a full-fledged app.

对于 M 和 C,哪些框架适合与它一起使用?如果我想实用怎么办?我应该只使用 jQuery 吗?

For the M and the C, what frameworks are cool to use with it? What if I want to go functional? Should I just use jQuery?

Routes、Ajax 和许多框架为我们提供的其他东西呢?

What about Routes, Ajax and the other things that many frameworks offers us?

推荐答案

你实际上可以直接去Fluxreact-routerFlux 基于 Stores、Actions 和 Dispatcher 的使用(取决于您使用的 Flux 实现).

You can actually go simply for Flux and react-router Flux is based on the usage of Stores, Actions, and Dispatcher (depending on the implementation of Flux you use).

商店将在 MVC 框架中扮演模型的角色.控制器 (C) 部分在 Flux 的上下文中更难解释,但可能是您的一些 React 组件与 Stores 结合起来被视为控制器.

The Stores will play the role of the Models in an MVC framework. The Controller (C) part is trickier to explain in the context of Flux, but it would be probably some of your React components that could be considered controller, combined with the Stores.

React-router 可以轻松管理 React 应用中的路由.

React-router makes it easy to manage routing in your React apps.

我更一般的建议是不要寻找酷"的框架来制作你的应用程序,而是问问自己什么是最快的实现,最容易维护和测试,以及什么堆栈将是最简单的做这项工作.有时,越简单越好.

My more general advice would be to not look for "cool" frameworks to make your apps, but ask yourself what is going to be the fastest to implement with, the easiest to maintain and test, and what stack is going to be the simplest to do the job. Sometimes, simpler is much better.

这篇关于如果 React.js 是 V,那么在 MVC 中,其他字母是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆