react-bootstrap-datetimerangepicker icon indicating copy to clipboard operation
react-bootstrap-datetimerangepicker copied to clipboard

Does not work in react 16

Open prashand opened this issue 7 years ago • 8 comments

TypeError: _react2.default.PropTypes is undefined when trying to use this component.

prashand avatar Nov 18 '17 08:11 prashand

I just noticed that the Github source has been migrated to PropTypes. It's just the npm package that is outdated. Please publish the current version to npm.

prashand avatar Nov 18 '17 08:11 prashand

I've submitted a PR that will fix the build. Just waiting for it to be merged and pushed to npm. In the meantime you can mitigate the issue with PropTypes using dependency injection by doing something like this:

var React = require('react'),
$ = require('jquery'),
DatetimeRangePicker;
React.PropTypes = require('prop-types');
DatetimeRangePicker = $.extend(require('react-bootstrap-datetimerangepicker'), { _react: React });

cmyers avatar Nov 23 '17 12:11 cmyers

Any chance on moving it up? Component is unusable for now

jakoss avatar Dec 04 '17 07:12 jakoss

Unfortunately the project owner doesn't seem active anymore so the pull requests aren't getting looked at. You could try this component instead which is more or less an up to date clone https://github.com/skratchdot/react-bootstrap-daterangepicker

cmyers avatar Dec 04 '17 14:12 cmyers

I hope this gets fixed soon since it is entirely broken at this point while using the latest React version.

harshayburadkar avatar Jan 03 '18 11:01 harshayburadkar

You can just use the files in the "src" folder as regular react components to get this working. Make sure to install all dependencies. That's what I did and it works fine. Let me know if this works for you guys.

arieu avatar Apr 24 '18 21:04 arieu

This didn't work for me.. I used the source but I still get the same problems. Anyone able to get this fixed?

Uncaught TypeError: Cannot read property 'any' of undefined at index.js:42 at Object../node_modules/react-bootstrap-datetimerangepicker/lib/index.js (index.js:195)

axwack avatar May 08 '18 13:05 axwack

You can also do this in package.json to install from GitHub:

"dependencies": { "react-bootstrap-datetimerangepicker": "luqin/react-bootstrap-datetimerangepicker#master", },

nichines avatar Jan 31 '20 16:01 nichines