Once I started to use Typescript in React I notice one thing I don't like which is to the need to declare every props to a component. Before this we can use {...props} but now I have to declare in interface every single native props like ref, placeholder, defaultValue etc.
interface InputProps {
customProp: boolean;
props: any;
}
const Input = ({ customProp, placeholder, ...props }: InputProps) => {
//warning
return <input type="text" {...props} />;
};
https://codesandbox.io/s/distracted-burnell-vlt3i?file=/src/App.tsx
I want to enjoy the old day where I only need to declare non-native prop in the interface, possible? the native props has been passed via {...props}