react jquery_您应该使用jQuery还是React?

react jquery

First, you might not need jQuery at all, and just use the Web Platform APIs, but this is another story.

首先,您可能根本不需要jQuery,仅使用Web平台API,但这是另一回事了。

Let’s focus on the question. Should you use jQuery or React?

让我们关注这个问题。 您应该使用jQuery还是React?

My answer is this. If you are building a Single Page Application, React is the obvious choice. React was built for this, and will take care of generating the views and rendering the elements in the page without you having to even think about the DOM, aka the nitty-gritty details of how to present the content on the page.

我的答案是这个。 如果要构建单页应用程序,React是显而易见的选择。 React是为此而构建的,它将负责生成视图和呈现页面中的元素,而您甚至不必考虑DOM,也就是如何在页面上呈现内容的细节。

React follows a declarative approach, and using it you can work at a much higher level.

React遵循声明式方法,使用它您可以在更高的层次上工作。

jQuery (or the native browser APIs) should not really be used when building an SPA, as things might get complicated very quickly.

构建SPA时,不应真正使用jQuery(或本机浏览器API),因为事情可能会很快变得复杂。

It’s best suited at adding interactive parts to a page that’s most likely server-rendered, although it can co-exist within a React app.

尽管它可以在React应用程序中共存,但最适合将交互式部分添加到最有可能是服务器渲染的页面上。

With jQuery you interact directly with the DOM to select elements, using selectors to find the thing in the page you want to act upon.

使用jQuery,您可以直接与DOM交互以选择元素,并使用选择器在页面上找到要操作的内容。

It’s both much lower level, and more prone to complications as the size of your application grows.

随着应用程序规模的扩大,它的级别要低得多,而且更容易出现复杂性。

翻译自: https://flaviocopes.com/jquery-vs-react/

react jquery

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值