RequireJS caches the return value of a module so it only has to fetch it once, all prior variables are shared between the instances. To use a separate daterangepicker
for each instance, you could attach it to your view:
return Backbone.View.extend({
initialize: function (opt) {
this.dtRngPckr = require('daterangepicker');
},
render: function () {
this.dtRngPckr();
},
onClose: function () {
this.dtRngPckr = null;
}
});