[英]How to use a jQuery dependent node module in React.js?
I want to use this library in my React application: http://propeller.in , but it's built on jQuery. 我想在我的React应用程序中使用这个库: http : //propeller.in ,但是它是基于jQuery构建的。 I have added the following relevant code in my Index.js React component:
我在Index.js React组件中添加了以下相关代码:
import $ from 'jquery';
import 'propellerkit/dist/js/propeller.js';
I've also tried this: 我也尝试过这个:
import 'jquery/dist/js/jquery.js';
import 'propellerkit/dist/js/propeller.js';
I've made sure both node modules are installed. 我确保两个节点模块都已安装。 For some reason, I keep getting a
$ is not defined
error. 由于某种原因,我不断收到
$ is not defined
错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.