英文:
Qwik-react calendar plugin '@aldabil/react-scheduler' showing but not functional: How to troubleshoot?
问题
Qwik-react Scheduler未能正常工作。
我尝试在我的qwik应用中使用qwik-react使用“@aldabil/react-scheduler” react插件,但我遇到了这个错误。日历显示出来了,但功能无法正常工作,比如当我点击单元格时,什么都不会发生。
错误:未找到命名导出“Scheduler”。所请求的模块“@aldabil/react-scheduler”是一个CommonJS模块,可能不支持所有模块导出为命名导出。
CommonJS模块可以始终通过默认导出导入
我期望能在qwik-react应用中运行“@aldabil/react-scheduler”。
英文:
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
I was expecting to make the "@aldabil/react-scheduler" running in qwik-react application
答案1
得分: 1
你可以以这种方式导入React组件来解决你的问题。
这段代码在开发和预览模式下工作。
/** @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' });
英文:
You can import the React component in this way to solve your issue.</br>
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' });
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论