I want to add a play icon to my antd-Button
component in (React
), I tried to follow antd-Icon documentation and Icon font help without success in generating scriptUrl
From official docs:
const MyIcon = Icon.createFromIconfontCN({
scriptUrl: '//at.alicdn.com/t/font_8d5l8fzk5b87iudi.js', // generated by iconfont.cn
});
ReactDOM.render(<MyIcon type="icon-example" />, mountedNode);
scriptUrl
is The URL generated by iconfont.cn project.The property scriptUrl should be set to import the SVG sprite symbols.
Here is a snippet from my code:
const PlayIcon = Icon.createFromIconfontCN({
scriptUrl: '', // How to generate url?
});
// Button inside component
<Button shape="circle" onClick={someAction}>
<PlayIcon type="icon-play"/>
</Button>