kadirahq / mantra

Mantra - An Application Architecture for Meteor
https://kadirahq.github.io/mantra/
976 stars 51 forks source link

Jquery Plugins #122

Open artistic-differences opened 8 years ago

artistic-differences commented 8 years ago

How to use Jquery plugins in Mantra?

Firstly apologies not sure if this is specific to Mantra, ES6, NPM or Babel - I am used to just running a meteor command to add a package and it just working.

I was trying to use the NPM package for FullCalendar in a react component. I install the package with npm install --save fullcalendar

and in the the component.jsx included an import reference below the react reference

import React from 'react' import FullCalendar from 'fullcalendar'

the package.json seemed to include fullcalendar and Jquery / $ is available in the javascript console

However when it comes to access the plugin it throws an undefined error.

$(selector).fullCalendar() -> error fullCalendar is undefined.

Can someone help as to how I might resolve this. I think the problem is probably due to a lack of knowledge on my part and also specific to how jquery plugins are imported / used in an npm context.

Thanks

sandervanhooft commented 8 years ago

React and JQuery don't work together that well, see this post for more information. Try to use a React calendar instead.