Open donnrri opened 8 years ago
+1 - exact same issue. btw, it is not even required to use it; just including it like so: var RangePicker = require('react-daterange-picker'); is sufficient to throw the error.
@donnrri / @krsnaa Sorry - i'm unable to reproduce with my setup.
Do you have a sample project that demonstrates the error? Or if not, could you possibly list what version of react-daterange-picker
/ React / Babel etc that you're using
@AlanFoster - thanks for your reply - below is the appropriate snippet from my package.json.
"dependencies": { "react": "^0.14.3", "react-daterange-picker": "^1.0.0", "react-dom": "^0.14.3" }, "devDependencies": { "babel-core": "^5.8.34", "babel-loader": "^5.3.3", "webpack": "^1.12.9" }
from a cursory look, it appears that the root parameter sent to moment-range is undefined and just setting it to an empty object like so (in moment-range.js), seems to help.
if (typeof root === "undefined") { root = {}; }
Install the npm package
Add to jsx using var DateRange = require('react-daterange-picker');
use
error: Uncaught TypeError: Cannot set property 'DateRange' of undefined
Any ideas ?