问题描述
我正在将我的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/Hybrid应用程序-它是本机应用程序,其逻辑由Javascript控制,并使用具有虚拟视图层次结构表示形式的react模式.网络应用程序中唯一常见的部分是Javascript引擎(没有CSS/HTML). Phonegap应用程序是使用Web视图的Hybrid 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做出反应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!