Avatar ·

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

Olá a todos! Sou novo em TypeScript e React, e estou com um problema que não consigo resolver há várias horas. Estou tentando criar um componente tipado usando Material-UI e me deparei com o erro TS2749. Aqui está meu código: ```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 (