可以反应原生使用 jQuery [英] Can react native use jQuery

查看:15
本文介绍了可以反应原生使用 jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将我的 phonegap 应用程序迁移到 react-native.

I am migrating my phonegap apps into react-native.

由于我的 phonegap 应用使用了很多 jQuery 插件,所以我很好奇 react-native 是否可以使用 jQuery.

Since my phonegap apps use a lot of jQuery plugins, so I am curious if react-native can use jQuery.

推荐答案

不.JQuery 严重依赖 HTML DOM 和 CSS,其中 react-native 有自己的类似 DOM 的本机视图层次结构和自己的样式实现,类似于 CSS 的子集(flex-box),但实现方式不同.

Nope. JQuery heavily relies on HTML DOM and CSS where react-native has their own DOM-like native view hierarchy with their own style implementation which is similar to subset of CSS (flex-box) but it is implemented differently.

只是从一个角度来看 - React-Native 应用程序不是 HTML/混合应用程序 - 它是一个本地应用程序,其逻辑由 Javascript 控制,并使用具有虚拟视图层次结构表示的反应模式.Web 应用程序唯一的共同部分是 Javascript 引擎(没有 CSS/HTML).Phonegap 应用程序是使用 Web 视图的混合 HTML 应用程序,因此它们可以使用不是纯 JavaScript 而是与 HTML/CSS 相关联的框架/插件.

Just to put it in perspective - React-Native app is NOT an HTML/Hybrid app - it's a native app with logic controlled by Javascript and using react patterns with virtual view hierarchy representation. The only common part with web apps is Javascript engine (no CSS/HTML). Phonegap apps are Hybrid HTML apps using web views so they can use frameworks/plugins that are not pure javascript but tied to HTML/CSS.

这篇关于可以反应原生使用 jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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