import * as React from 'react';

export enum ActionType {
  zoomIn = 1,
  zoomOut = 2,
  prev = 3,
  next = 4,
  rotateLeft = 5,
  rotateRight = 6,
  reset = 7,
  close = 8,
  scaleX = 9,
  scaleY = 10,
  download = 11,
}

export interface IconProps {
  type: ActionType;
}

export default function Icon(props: IconProps) {
  let prefixCls = 'react-viewer-icon';

  return (
    <i className={`${prefixCls} ${prefixCls}-${ActionType[props.type]}`}></i>
  );
}

import * as React from 'react';

export enum ActionType {
  zoomIn = 1,
  zoomOut = 2,
  prev = 3,
  next = 4,
  rotateLeft = 5,
  rotateRight = 6,
  reset = 7,
  close = 8,
  scaleX = 9,
  scaleY = 10,
  download = 11,
}

export interface IconProps {
  type: ActionType;
}

export default class Icon extends React.Component<IconProps, any> {
  render() {
    let prefixCls = 'react-viewer-icon';

    return (
      <i className={`${prefixCls} ${prefixCls}-${ActionType[this.props.type]}`}></i>
    );
  }
}

--- 
+++ 
@@ -18,12 +18,10 @@
   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>
+  );
 }
Fix "TypeError: Super expression must either be null or a function"
