简体   繁体   中英

Import javascript library into React Native

I have a javascript library in my project. This library need external jquery libraries like this:

<script src="jquery.min.js"></script> 
<script src="jquery.signalR.js"></script> 
<script src="myLibrary.min.js"></script> 

Is there a way to use this library on my React Native project? Can I import jquery into my project? Thanks

You can't use jQuery with react-native.

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.

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. source : stackoverflow

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM