Ao tentar rodar o projeto react a seguinte mensagem é apresentada:
Failed to compile ./src/componentes/ListaSuspensa/index.js Line 11: 'React' must be in scope when using JSX react/react-in-jsx-scope Line 12: 'React' must be in scope when using JSX react/react-in-jsx-scope Line 13: 'React' must be in scope when using JSX react/react-in-jsx-scope Line 18: 'React' must be in scope when using JSX react/react-in-jsx-scope Line 20: 'React' must be in scope when using JSX react/react-in-jsx-scope
Search for the keywords to learn more about each error. This error occurred during the build time and cannot be dismissed.
import "./ListaSuspensa.css";
const ListaSuspensa = (
label,
itens,
valor,
aoAlterado,
obrigatorio = false
) => {
return (
<div className="lista-suspensa">
<label>{label}</label>
<select
required={obrigatorio}
value={valor}
onChange={(evento) => aoAlterado(evento.target.value)}
>
<option value=""></option>
{itens.map((item) => (
<option key={item}>{item}</option>
))}
</select>
</div>
);
};
export default ListaSuspensa;