mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
parent
610807ebf9
commit
850b670862
@ -144,6 +144,8 @@ You can import SVG icon as a react component by using `webpack` and [`@svgr/webp
|
||||
```jsx
|
||||
import Icon from '@ant-design/icons';
|
||||
import MessageSvg from 'path/to/message.svg'; // path to your '*.svg' file.
|
||||
// in create-react-app:
|
||||
// import { ReactComponent as MessageSvg } from 'path/to/message.svg';
|
||||
|
||||
ReactDOM.render(<Icon component={MessageSvg} />, mountNode);
|
||||
```
|
||||
|
@ -139,6 +139,8 @@ ReactDOM.render(<MyIcon type="icon-example" />, mountedNode);
|
||||
```jsx
|
||||
import Icon from '@ant-design/icons';
|
||||
import MessageSvg from 'path/to/message.svg'; // path to your '*.svg' file.
|
||||
// in create-react-app:
|
||||
// import { ReactComponent as MessageSvg } from 'path/to/message.svg';
|
||||
|
||||
ReactDOM.render(<Icon component={MessageSvg} />, mountNode);
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user