Closed osman-sultan closed 3 months ago
Hi @osman-sultan
i was checking u're issue, and it is not related to the component it self, it seems the FIle object offered by js it self , it not recognizable in u're it self, but for the component it self it working normally and there is no issue regarding in it, as u see in the image that i shared with u.
Some fixes that i saw people do when having issues with ts declaration in this sense, is to make custom inferences, like this
type FileType = typeof File extends new (...args: any[]) => infer T ? T : never;
And u can make it available across all u're app by declaring an global object, something like this
declare global { type FileType = FileType; }
,
You can put it inside a types file, then add it to compiler option
{ "compilerOptions": { // ... other options "typeRoots": ["./node_modules/@types", "./types"] } }
So when compiling the code from ts to js, the compiler will understand those options.
I am getting error:
I tried adding react-hook-form to it functionally my app is fine but this error occurs on initial page load and thus my app doesn't build. Not sure whats causing it.
Here is my full code: