I have FullCalendar configured for my React site. Everything works fine except for having too frequent refetching from server. In below example (which I have simplified), I change Redux state from a different component which logs out 'hello' in the console. Everytime it happens, I also get 'getting resources' logged out (in the usual environment this is an API call). Same happens for event refetching.It also happens every time any state variable in the component changes. Ideally, I want FullCalendar to fetch events on initialization only and refetch them manually or when navigating on the actual calendar. I don't need it refetched every time anything happens on the page/component. Is that possible?
export default function CalendarPlanner(){
const reduxState = useSelector(state => state.calPlanner);
const getResources = () => {
console.log('getting resources');
};
useEffect(() => {
console.log('hello');
}, [reduxState]);
return (
<FullCalendar plugins={[resourceTimelinePlugin, interaction, dayGridPlugin]}
resources={getResources}
/>
}