Closed krau5 closed 3 years ago
For me worked creating a file react-alert-template-basic.d.ts
and put declare module 'react-alert-template-basic';
in it.
I don't want to create file, I just wanna install this library and continue working
@Krausso
AlertTemplate.zip
Download the above folder and create a libs directory and use it like below
import React from "react";
import AlertTemplate from "../libs/AlertTemplate";
import App from "../App";
const options = {
timeout: 50000,
position: positions.BOTTOM_CENTER
};
const IndexPage: React.FC<{}> = (props) => {
return (
<Provider template={AlertTemplate} {...options}>
<App/>
</Provider>
)
}
In the example above options should be typed as const options: AlertPosition | any = {...
and template as const AlertTemplate: ComponentType<AlertComponentPropsWithStyle> = ({ options, message, close } : any) => (
Working fine
Types for react-alert-template-basic does not exist