React Kendo UI TreeView抛出“未定义剑道" [英] React Kendo UI TreeView throws 'kendo is not defined'
问题描述
我正在用Kendo UI进行React项目.我遵循了 Kendo UI TreeView
I am working on a React project with Kendo UI. I followed the steps from Kendo UI TreeView
我已经安装了@progress/kendo-treeview-react-wrapper
,@progress/kendo-ui
,并使用import '@progress/kendo-theme-material/dist/all.css';
I have installed @progress/kendo-treeview-react-wrapper
, @progress/kendo-ui
and imported theme into my project using import '@progress/kendo-theme-material/dist/all.css';
当我使用KendoUI按钮时,一切正常,功能和主题均正常,但是在使用TreeView
When I use KendoUI buttons, everything is working, the functionality and theme are expected, but it throws below Error when use TreeView
Uncaught ReferenceError: kendo is not defined
at TreeView.componentDidMount (bundle.js:69556)
at commitLifeCycles (bundle.js:12471)
at commitAllLifeCycles (bundle.js:14142)
at HTMLUnknownElement.callCallback (bundle.js:2787)
at Object.invokeGuardedCallbackDev (bundle.js:2825)
at invokeGuardedCallback (bundle.js:2874)
at commitRoot (bundle.js:14281)
at completeRoot (bundle.js:15189)
at performWorkOnRoot (bundle.js:15139)
at performWork (bundle.js:15057)
bundle.js:12330 The above error occurred in the <TreeView> component:
in TreeView (created by AssetsStatusTreeView)
in div (created by AssetsStatusTreeView)
in AssetsStatusTreeView (created by Connect(AssetsStatusTreeView))
in Connect(AssetsStatusTreeView) (created by Route)
in Route
in Switch
in Router (created by BrowserRouter)
in BrowserRouter
in Provider
Uncaught TypeError: Cannot read property 'call' of undefined
at TreeView.KendoBaseComponent.componentWillUnmount (bundle.js:69569)
at callComponentWillUnmountWithTimer (bundle.js:12390)
at HTMLUnknownElement.callCallback (bundle.js:2787)
at Object.invokeGuardedCallbackDev (bundle.js:2825)
at invokeGuardedCallback (bundle.js:2874)
at safelyCallComponentWillUnmount (bundle.js:12397)
at commitUnmount (bundle.js:12643)
at unmountHostComponents (bundle.js:12986)
at commitDeletion (bundle.js:13016)
at commitAllHostEffects (bundle.js:14100)
任何人都可以帮忙吗?谢谢!
Can anyone help? Thanks!
推荐答案
Kendo React的说明是:
The instructions from Kendo React is :
还有一个步骤要做,我们需要显式导入@progress/kendo-ui
:
There's one more step to do, we need import @progress/kendo-ui
explicitly:
import kendo from '@progress/kendo-ui';
KendoUI的 Plunker示例帮我弄清楚了.
The Plunker Examples from KendoUI helps me figure it out.
这篇关于React Kendo UI TreeView抛出“未定义剑道"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!