0

Here I am trying to use Zebradatepicker in my reactjs application. Below is the sample code I am trying to execute in onclick function of react application.

$("#datepicker_start").Zebra_DatePicker({ format: 'm-d-Y' });

Below is the error which i see.

TypeError: jquery__WEBPACK_IMPORTED_MODULE_3___default(...)(...).Zebra_DatePicker is not a function

So i wanted to use Zebradatepicker in react application.

1 Answers1

0

first you install jquery

npm install jquery

secondly you have to install zebra

npm i zebra_datepicker

thirdly you have to work with zebra

window.$ = window.jQuery = require('jquery')

fourthly you have to do this

Import the loader into your root file before you import the files which require jquery app.js

import 'pathToYourZebra/zebra_datepicker.js'
Radiant Ahmed
  • 191
  • 10
  • I am able to use jquery but the problem is with zebra_datepicker(https://github.com/stefangabos/Zebra_Datepicker ).Here that is not able to use with jquery – Ritesh Tiwari Oct 01 '20 at 15:30
  • @RiteshTiwari you can try https://www.npmjs.com/package/react-datepicker this if its not compulsory to use zebra really sorry didnt know why zebra is not working at your side even here is another example https://stackoverflow.com/questions/38836553/how-to-use-jquery-ui-with-react-js/40350880#40350880 – Radiant Ahmed Oct 01 '20 at 17:10