Fix "TypeError: Super expression must either be null or a function"

This commit is contained in:
Wang-gon Kim 2019-10-30 10:34:21 +09:00
parent 2f6cf11d8a
commit b7411dd3a2

View File

@ -18,12 +18,10 @@ export interface IconProps {
type: ActionType;
}
export default class Icon extends React.Component<IconProps, any> {
render() {
let prefixCls = 'react-viewer-icon';
export default function Icon(props: IconProps) {
let prefixCls = 'react-viewer-icon';
return (
<i className={`${prefixCls} ${prefixCls}-${ActionType[this.props.type]}`}></i>
);
}
return (
<i className={`${prefixCls} ${prefixCls}-${ActionType[props.type]}`}></i>
);
}