首页 > 解决方案 > ag-grid-react 正在尝试导入 WrapableInterface 但在 ag-grid-community 中不存在

问题描述

这是我的 index.tsx

import { render } from 'react-dom';
import aggridcommunity from "ag-grid-community";
import aggridreact from "ag-grid-react";

构建错误:

node_modules/.pnpm/ag-grid-react@25.3.0_424f61aa2bacf9dc35e0f78db1edf809/node_modules/ag-grid-react/lib/reactComponent.d.ts:2:37 - 错误 TS2724: '"../../../. ./../ag-grid-community/main"' 没有名为 'WrapableInterface' 的导出成员。您的意思是“WrappableInterface”吗?

2 从“ag-grid-community”导入 { ComponentType、IComponent、WrapableInterface };

当我搜索这个文件时:

node_modules/.pnpm/ag-grid-react@25.3.0_424f61aa2bacf9dc35e0f78db1edf809/node_modules/ag-grid-react/lib/reactComponent.d.ts

未找到 WrapableInterface

import { ComponentType, IComponent, WrapableInterface } from 'ag-grid-community';

如何在 index.d.ts 中扩展 ag-grid-community 模块以包含它?

标签: typescriptag-grid-react

解决方案


推荐阅读