javascript - How to use a jQuery dependent node module in React.js? -
i want use library in react application: http://propeller.in, it's built on jquery. have added following relevant code in index.js react component:
import $ 'jquery'; import 'propellerkit/dist/js/propeller.js'; i've tried this:
import 'jquery/dist/js/jquery.js'; import 'propellerkit/dist/js/propeller.js'; i've made sure both node modules installed. reason, keep getting $ not defined error.
if using webpack bundle, can provide jquery using provideplugin,
new webpack.provideplugin({ $: 'jquery', jquery: 'jquery' // try find node jquery module }) link docs
Comments
Post a Comment