pro-chat icon indicating copy to clipboard operation
pro-chat copied to clipboard

🧐[问题] properties of null (reading 'useContext')

Open hello-yajing opened this issue 9 months ago • 6 comments

🧐 问题描述

自定义Actions中的按钮引入antd的Button/图标,会报错: image

💻 示例代码

`

{ return [
, ...defaultDoms, ]; }, flexConfig: { gap: 24, direction: 'horizontal', justify: 'space-between', }, }} request={async (messages) => { const mockedData: string = `这是一段模拟的流式字符串数据。本次会话传入了${messages.length}条消息`;
      const mockResponse = new MockResponse(mockedData);

      return mockResponse.getResponse();
    }}
  />
</div>

`

🚑 其他信息

版本信息: ` { "private": true, "author": "yj ********@qq.com", "scripts": { "dev": "umi dev", "build": "umi build", "postinstall": "umi setup", "setup": "umi setup", "start": "npm run dev" }, "dependencies": { "@ant-design/pro-chat": "^1.12.2", "antd": "^5.16.1", "antd-style": "^3.6.2", "umi": "^4.1.9" }, "devDependencies": { "@types/react": "^18.0.33", "@types/react-dom": "^18.0.11", "typescript": "^5.0.3" } }

`

hello-yajing avatar May 08 '24 08:05 hello-yajing

image 代码重新发一下

hello-yajing avatar May 08 '24 08:05 hello-yajing

感觉错误不在这里,我这边一切良好。

antd/icons 需要你手动安装下,我看你的 packagejson 并没有指定,可以试试指定下

ONLY-yours avatar May 08 '24 09:05 ONLY-yours

感觉错误不在这里,我这边一切良好。

antd/icons 需要你手动安装下,我看你的 packagejson 并没有指定,可以试试指定下

手动安装了,还是报错;换成了“lucide-react”能解决问题

hello-yajing avatar May 08 '24 09:05 hello-yajing

image

hello-yajing avatar May 08 '24 09:05 hello-yajing

有点奇怪,我这个issue先放着,如果我这边能复现到问题,我在这里继续推进。

ONLY-yours avatar May 09 '24 03:05 ONLY-yours

有点奇怪,我这个issue先放着,如果我这边能复现到问题,我在这里继续推进。

好嘞,非常感谢~

hello-yajing avatar May 09 '24 07:05 hello-yajing