i cant resolve my problem. I have a file where I declare a class with the following code in lama.d.ts
export declare class lama {
// code here
}
Then I import this in another file in the same folder of my react project
import { lama} from './lama.d';
But I have the following error : Attempted import error: 'lama' is not exported from './lama.d'.
It does the same in a .ts instead of .d.ts file. And the mostt weird is that if I export another class from this file (lama.d.ts) that I import from another file to lama.d.ts , it works , but not the class that i wantt to work.
thank you for reading me
i cant resolve my problem. I have a file where I declare a class with the following code in lama.d.ts
export declare class lama {
// code here
}
Then I import this in another file in the same folder of my react project
import { lama} from './lama.d';
But I have the following error : Attempted import error: 'lama' is not exported from './lama.d'.
It does the same in a .ts instead of .d.ts file. And the mostt weird is that if I export another class from this file (lama.d.ts) that I import from another file to lama.d.ts , it works , but not the class that i wantt to work.
thank you for reading me
Share Improve this question asked Dec 14, 2021 at 10:19 LamaLama 311 gold badge3 silver badges5 bronze badges1 Answer
Reset to default 2I had the same error, but used export default and it worked!
declare class lama {
// code here ..
export default lama
}
When import :
import lama from './lama.d'
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745155720a4614109.html
评论列表(0条)