I am converting a project over to Typescript. I am having issues with toastr.
import {toastr} from "toastr";
I downloaded the typescript definition file with Nuget and included it in the project.
It has this export at the end of the file:
declare var toastr: Toastr;
declare module "toastr" {
export = toastr;
}
However, I get the compile time error: Modle "toastr" has no exported member 'toastr'
How to I resolve this issue?
Try the following:
import * as toastr from "toastr";
Doing that will import the entire module as toastr
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With