I am creating a react-native component using Typescript for the first time. And I get this following error in line 51: Property 'propTypes' does not exist on type 'typeof TextInput
Similar topics didn't help me. Does someone have an idea? Thanks
import React from "react";import { View, TextInput, StyleSheet, Text } from "react-native";import PropTypes from "prop-types";export type InputProps = { label: any; inputStyle: any; containerStyle: any; touched: any; error: any;};const Input = ({ label, inputStyle, containerStyle, touched, error, ...props}: Partial <InputProps>) => { return (<View style={containerStyle}><Text>{label}</Text><TextInput style={inputStyle} {...props} /><Text style={styles.errorInput}>{touched && error}</Text></View> );};const styles = StyleSheet.create({ containerStyle: { marginVertical: 5, }, input: { borderBottomWidth: 1, minHeight: 40, padding: 10, }, errorInput: { color: "red", fontSize: 12 },});const stylePropsType = PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.object), PropTypes.object,]);Input.propTypes = { inputStyle: stylePropsType, containerStyle: stylePropsType, ...TextInput.propTypes, // I have an error: "Property 'propTypes' does not exist on type 'typeof TextInput'.ts(2339)"};Input.defaultProps = { inputStyle: styles.input, containerStyle: styles.containerStyle, touched: false, error: null,};export default Input;