antd v4 使用后台返回的icon type的icon,并绑定事件
import React from "react"; import * as Icon from '@ant-design/icons'; var iconType = 'MessageOutlined'; export default function App() { return ( <div > { React.createElement(Icon[iconType], { onClick: () => { alert('lol') }, }, 'Click me') } </div> ); }