Merge pull request #85 from miho7031/master

Fix "TypeError: Super expression must either be null or a function"
This commit is contained in:
feng zhi hao 2019-10-30 10:02:23 +08:00 committed by GitHub
commit f82d907e95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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>
);
}