gpt4 book ai didi

javascript - 将 javascript 库导入 React Native

转载 作者:行者123 更新时间:2023-12-02 23:33:27 25 4
gpt4 key购买 nike

我的项目中有一个 javascript 库。该库需要像这样的外部 jquery 库:

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

有没有办法在我的 React Native 项目中使用这个库?我可以将 jquery 导入到我的项目中吗?谢谢

最佳答案

您不能将 jQuery 与 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

关于javascript - 将 javascript 库导入 React Native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56390367/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com