I am trying to include this module: https://www.npmjs.com/package/react-datepicker-component with react into my Laravel Framework.
I went on to using npm to install it but I am getting no where after that.
I could use some direction. Has anyone tried using NPM for Laravel other than for Laravel Elixir?
I was stuck with this same issue for about an hour trying to pull in the inputmask node package.
The only way I was able to get it included was by attaching it to the window object in app.js (similar to what bootstrap.js does)
window.InputMask = require('inputmask');
If you don't want to load it every time (as it would with app.js) you can create a separate js file that contains only the line of code above and load that on select pages. I feel like there has to be a better way, but this is the only way I've found to make it work.
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