I am trying to make a tic tac toe game, but unfortunately, I am getting error under switch statement.
1.import React from 'react';
2.import {FaTimes, FaPen, FaRegCircle} from 'react-icons/fa';
3.
4.const Icon = ({name}) =>(
5. ***switch*** (name) {
6. case "cirle":
7. <FaRegCircle className='icons'></FaRegCircle>
break;
case "cross":
<FaTimes className='icons'></FaTimes>
break;
default:
<FaPen className='icons'></FaPen>
break;
};
);
export default Icon;
I am getting an error in the 5th line saying Expression expected.ts(1109)
under switch keyword.
Why did this problem appear and how do I resolve it??