In App.js
import "./styles.css";
import { IconType }, Icon from "./icons"; //<-this line gives syntax error
export default function App() {
return <Icon icon=IconType.Complete/>
};
In icon.js
import React, { useMemo } from 'react';
export enum IconType //<-this line gives syntax error
{
Complete,
Active,
Risk,
Overdue
}
const Icon = ({ props }) => {
if (props.icon === IconType.Complete){
return <h1>icon</h1>
}
}
export default Icon;
See codesanbox
How should I fixed the syntax error above marked in the comment?