rusackas commented on a change in pull request #11491:
URL: 
https://github.com/apache/incubator-superset/pull/11491#discussion_r514609021



##########
File path: superset-frontend/src/common/components/index.tsx
##########
@@ -17,16 +17,35 @@
  * under the License.
  */
 import { styled } from '@superset-ui/core';
+// eslint-disable-next-line no-restricted-imports
 import { Skeleton } from 'antd';
+import AntdMenuItem from 'antd/lib/menu/MenuItem';
 
 /*
-  Antd is exported from here so we can override components with Emotion as 
needed.
+  Antd is re-exported from here so we can override components with Emotion as 
needed.
 
   For documentation, see https://ant.design/components/overview/
  */
-/* eslint no-restricted-imports: 0 */
+// eslint-disable-next-line no-restricted-imports
+export {
+  Avatar,
+  Card,
+  Collapse,
+  Empty,
+  Dropdown,
+  Menu,
+  Modal,
+  Popover,
+  Skeleton,
+  Tabs,
+  Tooltip,
+} from 'antd';
 
-export * from 'antd';
+export const MenuItem = styled(AntdMenuItem)`

Review comment:
       We could export a patched `Menu` that provides the same compound 
component support as AntD, so you don't have to change all the other files from 
`Menu.Item` to `MenuItem`, then people familiar with AntD could use it as they 
normally would. 
   
   Something like:
   
   ```
   import { Menu as AntdMenu } from 'antd';
   
   export const Menu = Object.assign(
     AntdMenu,
     {
       Item: styled(AntdMenu.Item)`
         > a {
           text-decoration: none;
         }
       `,
       SubMenu: AntdMenu.SubMenu,
       ItemGroup: AntdMenu.ItemGroup,
       Divider: AntdMenu.Divider,
     },
   );
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to