Some of my classed do not pass type checking by ESLint with Typescript because of this error:
Object literal may only specify known properties, and 'selectedIndex' does not exist in type '{ zoomLevel: number; markerPointId: number; isLocationEnabled: boolean; markerIdFromProps: number; userPosition: { latitude: number; angle: number; longitude: number; }; mapRotate: boolean; darkMode: boolean; selectedRock: { ...; }; isModalVisible: boolean; isRockModalVisible: boolean; points: any[]; }'.
Example of this code:
export interface MyProps extends ViewProps { ... initialPage: number; ref?: React.Ref<MyComponent>;}interface MyState { selectedIndex: number;}export default class MyComponent extends React.Component< MyProps, MyState> { constructor(props: MyProps) { super(props); const {initialPage} = props; this.state = { selectedIndex: initialPage }; }...}
Error is on init state and in using state.