Я хотел стилизовать компонент из material-ui с @ emotion / Styled, но я получаю эту ошибку.
Error:(19, 5) TS2589: Type instantiation is excessively deep and possibly infinite.
Я попытался понизить до версии 3.5.3, как предлагали некоторые люди, но этоне решил проблему.
import * as React from 'react';
import styled from '@emotion/styled';
import TextField from '@material-ui/core/TextField';
const StyledTextField = styled(TextField)`
margin:10px;
`;
interface InputProps {
value: string;
name: string;
label: string;
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
}
const Input: React.FC<InputProps> = ({ value, name, label, onChange }) => {
return (
<StyledTextField
value={value}
name={name}
onChange={onChange}
label={label}
/>
);
};
export default Input;