{"action":"opened","issue":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/12805","repository_url":"https://api.github.com/repos/ant-design/ant-design","labels_url":"https://api.github.com/repos/ant-design/ant-design/issues/12805/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/12805/comments","events_url":"https://api.github.com/repos/ant-design/ant-design/issues/12805/events","html_url":"https://github.com/ant-design/ant-design/issues/12805","id":373359183,"node_id":"MDU6SXNzdWUzNzMzNTkxODM=","number":12805,"title":"Allow to render a custom ExpandIcon which is provided in rc-table@6.4.0","user":{"login":"maylukas","id":7526728,"node_id":"MDQ6VXNlcjc1MjY3Mjg=","avatar_url":"https://avatars1.githubusercontent.com/u/7526728?v=4","gravatar_id":"","url":"https://api.github.com/users/maylukas","html_url":"https://github.com/maylukas","followers_url":"https://api.github.com/users/maylukas/followers","following_url":"https://api.github.com/users/maylukas/following{/other_user}","gists_url":"https://api.github.com/users/maylukas/gists{/gist_id}","starred_url":"https://api.github.com/users/maylukas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maylukas/subscriptions","organizations_url":"https://api.github.com/users/maylukas/orgs","repos_url":"https://api.github.com/users/maylukas/repos","events_url":"https://api.github.com/users/maylukas/events{/privacy}","received_events_url":"https://api.github.com/users/maylukas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-24T08:18:17Z","updated_at":"2018-10-24T08:18:17Z","closed_at":null,"author_association":"NONE","body":"- [ ] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.\r\n\r\n### What problem does this feature solve?\r\nrc-table@6.4.0 implemented the functionality to customize the expand icon that is rendered in the tree table ([https://github.com/react-component/table/pull/236](https://github.com/react-component/table/pull/236/files))\r\nIt would be great if the dependency could be upgraded and the corresponding APIs could be extended to expose this feature.\r\n\r\nThis would allow library users to implement custom icons within the tree table. \r\nExample use case: \r\nIt would be possible to show a row-level loading indicator for lazy-loaded children.\r\n\r\n### What does the proposed API look like?\r\nExtend the props of the Table component:\r\n```\r\ninterface TableProps<ItemType> {\r\n...\r\nexpandIcon?: React.StatelessComponent<ExpandIconProps>\r\n...\r\n}\r\n\r\ninterface ExpandIconProps<ItemType> {\r\n  prefixCls: string;\r\n  expanded: boolean;\r\n  record: ItemType;\r\n  needIndentSpaced: boolean;\r\n  expandable: boolean;\r\n  onExpand: (record: ItemType, event: React.MouseEvent<any>) => void;\r\n}\r\n```\r\n\r\nI believe, that it is only possible to provide StatelessComponents as this statement which is executed to instantiate the component would fail for class-based components:\r\n[https://github.com/react-component/table/blob/master/src/ExpandableRow.js#L64](https://github.com/react-component/table/blob/master/src/ExpandableRow.js#L64)\r\n\r\n```\r\nrenderExpandIcon = () => {\r\n    const { prefixCls, expanded, record, needIndentSpaced, expandIcon } = this.props;\r\n     if (expandIcon) {\r\n      return expandIcon({\r\n        prefixCls,\r\n        expanded,\r\n        record,\r\n        needIndentSpaced,\r\n        expandable: this.expandable,\r\n        onExpand: this.handleExpandChange,\r\n      });\r\n    }\r\n```\r\n\r\n\r\n<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->"}}
{"actor":{"display_login":"maylukas"}}