I'm trying to import Jquery Rateyo into my project, but it seems to not work. Here's the code
import $ from "jquery";
import rateYo from "rateyo";
class Rating {
constructor() {
$(function() {
$("#rateYo").rateYo({
rating: 1.5,
starWidth: "40px",
numStars: 5,
halfStar: true
});
});
}
}
export default Rating;
I'm using webpack as well.
It does not show in the UI. And also generates an error saying,
jquery.js?1157:3841 jQuery.Deferred exception: jquery__WEBPACK_IMPORTED_MODULE_0___default(...)(...).rateYo is not a function TypeError: jquery__WEBPACK_IMPORTED_MODULE_0___default(...)(...).rateYo is not a function at HTMLDocument.eval (webpack-internal:///./js/modules/Rating.js:12:64) at mightThrow (webpack-internal:///./node_modules/jquery/dist/jquery.js:3557:29) at process (webpack-internal:///./node_modules/jquery/dist/jquery.js:3625:12) undefined