zp26
zp26

Reputation: 1527

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

Upvotes: 1

Views: 515

Answers (1)

Lo&#239;ck M
Lo&#239;ck M

Reputation: 358

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

Upvotes: 2

Related Questions