Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. solve the problem of bundle size.
  2.  
  3. Create a separated component for every single icon
  4. import StarFilled from 'antd/icons/StarFilled';
  5.  
  6. <StarFilled />
  7. Deprecate reference a icon as a string
  8. A deprecated warning will show when you reference an icon as a string in the following components:
  9.  
  10. <Icon type="star" />
  11. <Alert iconType="success" />
  12. <Avatar icon="star" />
  13. <Button icon="star" />
  14. Modal.confirm({ iconType: 'star' })
  15. For compatibility, we'll load an SVG sprite on demand when you reference an icon as a string.
  16.  
  17. Instead of referencing an icon as a string, you should pass ReactNode explicitly to these props:
  18.  
  19. import StarFilled from 'antd/icons/StarFilled';
  20.  
  21. <Avatar icon={<StarFilled />} />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement