Reputation: 1
I have an application with react and typescript and I would like to include lodash in my project and I inserted this in the global.d.ts
:
import type { LoDashStatic } from "lodash";
declare global {
let _: LoDashStatic;
}
But when I go to my web page I get this error in console:
Uncaught ReferenceError: _ is not defined
Of course I've already added lodash
and @types/lodash
into my environment
I expect it can use lodash globally since it has been declared
Upvotes: 0
Views: 501