跳到主要内容

将插件从 Grafana 11.5.x 版本迁移到 11.6.x

按照以下说明将插件从 Grafana 11.5.x 版本迁移到 11.6.x。

@grafana/runtime 中 usePluginComponents 选项已更改

由于意外使用了不正确的已弃用类型,我们更新了 hook 的选项 TypeScript 类型。此更改已通过 PR 100949 合并到 Grafana 核心仓库。

推荐操作

  • 调用 usePluginComponents 时移除 context 属性。context 应作为 props 传递给每个 Component。

请注意:这是一个构建时错误,在 Grafana 运行时不会产生任何影响。