I am using this datepicker plugin for react: https://github.com/Hacker0x01/react-datepicker
I keep getting the following error: Uncaught TypeError: this.props.moment is not a function in react-datepicker.min.js.
I just copied the example code, and I can see the input field, but whenever I click on it to render the calendar, it keeps giving the error above. Anyone know had this issue in the past?
Just resolved it, it was a matter of not requiring the "moment" js file in application.js. If you use bundler to install this plug in be sure to add the following into the gemfile:
source "https://rails-assets.org" do
gem 'rails-assets-react-date-picker'
gem "rails-assets-moment"
end
and then require both in application.js in this order:
//= require "moment"
//= require "react-date-picker"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With