Never update Icons

This commit is contained in:
maciejhirsz
2018-07-02 17:43:13 +02:00
parent 7ea9c8f7fc
commit 66bae3ed36
+12 -2
View File
@@ -8,6 +8,16 @@ export interface Props {
className?: string,
};
export function Icon(props: Props) {
return <ReactSVG title={props.alt} className={`Icon ${ props.className || '' }`} path={props.src} />;
export class Icon extends React.Component<{}, Props> {
public props: Props;
public shouldComponentUpdate() {
return false;
}
public render() {
const { alt, className, src } = this.props;
return <ReactSVG title={alt} className={`Icon ${ className || '' }`} path={src} />;
}
}