我试图在我的React项目中使用FullCalendar.io。
我已使用${myTestName}
安装了它。
我在目录中看到npm install fullcalendar
。
在我的项目中,我正在使用:
node_modules/fullcalendar
然后我有:
var Scheduler = require('fullcalendar');
但我收到此错误:var Calendar = React.createClass({
componentDidMount: function () {
$('#calendar').fullCalendar();
},
render: function () {
return (
<div id='calendar'>
</div>
);
}
});
。
(旁注 - 要求其他模块正常工作。我可以Uncaught TypeError: $(...).fullCalendar is not a function
然后var moment = require('moment')
并输出新的时刻变量。)
答案 0 :(得分:1)
确保要求所有需要在每个组件中启动的库。只需在索引文件中获取需要转换/捆绑的文件就不会有效。 (IT&#39; S那样的悲哀需要在一个阵营的应用程序使用jQuery,因为jQuery是克服地方/你的元素是不知道的问题,而在阵营您总是知道是什么你的元素是)