javascriptreactjsqwikqwikjs

Qwik-react calendar plugin '@aldabil/react-scheduler' showing but not functional: How to troubleshoot?


Qwik-react Scheduler not working. I was trying to use the "@aldabil/react-scheduler" react plugin in my qwik app using qwik-react but I got this error. the calendar is showing but the functionality is not working like when I cliked the cell there's nothing happen there.

Error: Named export 'Scheduler' not found. The requested module '@aldabil/react-scheduler' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export

enter image description here

enter image description here

I was expecting to make the "@aldabil/react-scheduler" running in qwik-react application


Solution

  • You can import the React component in this way to solve your issue. This code works in dev and preview mode

    /** @jsxImportSource react */
    
    import { qwikify$ } from '@builder.io/qwik-react';
    import AldabilReactScheduler, {Scheduler} from '@aldabil/react-scheduler';
    
    export const MyScheduler = qwikify$(import.meta.env.DEV ? Scheduler: AldabilReactScheduler.Scheduler, { eagerness: 'hover' });