Avatar ·

TypeScript error in React: "refers to a value, but is being used as a type here (TS2749)"

Hi everyone! I'm new to TypeScript and React, and I've encountered a problem that I've been unable to solve for several hours. I'm trying to create a typed component using Material-UI and I'm getting the TS2749 error. Here's my code: ```typescript import React, { useState } from 'react'; import TextField from '@mui/material/TextField'; import Button from '@mui/material/Button'; interface MyComponentProps { onSubmit: (data: string) => void; } const MyComponent: React.FC = ({ onSubmit }) => { const [value, setValue] = useState(''); const [error, setError] = useState(false); const handleSubmit = () => { if (!value) { setError(true); return; } onSubmit(value); }; return (