TypeError: Object(...) is not a function reactjs

It looks fine, you just have to export your function that's it.

use

export let fillCalendar = (month, year) => {

instead of

let fillCalendar = (month, year) => {

Just putting it out there....

I saw this error because I imported a function from the wrong module!

But I'm sure you'd never do that ;-)

(obviously a bit unlucky in that the function I imported had a common name - useParams in my case)


In addition to the accepted answer, I have observed that this error more generally occurs when the module/object being imported doesn't exist. I experienced it while trying to import a component of a library that had since removed the component. In my case, the specific component was FirebaseRealTimeSaga that is no longer available in the React Admin Firebase package