I am debugging a code I have not written, and I am new to typescript. I am getting a TS2339 error
Property 'InputFiles' does not exist on type '{}'.
I understand that this means that I am missing to hand-over the property, but what should I modify?
Within UI\src\containers\FileUploaderContainer.tsx
, I have something like
export class FileUploader extends React.Component<any, any> {
render() {
return ( <div><UploadFileFormContainer /></div> );
}
}
const FileUploaderContainer: { any } = connect(
state => ({ InputFiles: state.InputFiles }), // error occurs here
dispatch => ({})
)(FileUploader);
export default FileUploaderContainer;
Background
If I hover in Visual Studio above connect
, I see
(alias) connect<{InputFiles: any;}, any, {}, {}>(mapStateToProps: MapStateToPropsParam<{
InputFIles: any; }, {}, {}>, mapDispatchToProps: MapDispatchToPropsNonObject<any,{}>):
InterferableComponentEnhancerWithPropos<any,{}> (+ 14 overloads)
import connect
Related questions
The following issues did not help me to resolve my issue
- Typescript property does not exist on type {}
- Property 'xxx' does not exist on type '{}'
- property 'update' does not exist on type '{}'
- Property 'xxxx' does not exist on type '{ [key: string]: AbstractControl; }'
- How to resolve 'calls' does not exist on type '() => any'
- Property 'keys' does not exist on type 'any[]'
- Property does not exists on type '{}' using Promises