javascript - Running into problems using React Datepicker with rails -


i using datepicker plugin react: https://github.com/hacker0x01/react-datepicker

i keep getting following error: uncaught typeerror: this.props.moment not function in react-datepicker.min.js.

i copied example code, , can see input field, whenever click on render calendar, keeps giving error above. know had issue in past?

just resolved it, matter of not requiring "moment" js file in application.js. if use bundler install plug in sure add following gemfile:

source "https://rails-assets.org"   gem 'rails-assets-react-date-picker'   gem "rails-assets-moment" end 

and require both in application.js in order:

//= require "moment" //= require "react-date-picker" 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -