import * as React from 'react';
import {
AlertComponentPropsWithStyle,
AlertManager,
Provider as AlertProvider,
AlertProviderProps,
useAlert,
withAlert,
} from 'react-alert';
class AppWithoutAlert extends React.Component<{ alert: AlertManager }> {
render() {
return (
);
}
}
const customContext = React.createContext(undefined);
const App = withAlert(customContext)(AppWithoutAlert);
const AlertHook = (): JSX.Element => {
const alert = useAlert();
return (
);
};
class AlertTemplate extends React.Component {
render() {
// the style contains only the margin given as offset
// options contains all alert given options
// message is the alert message...
// close is a function that closes the alert
const { style, options, message, close } = this.props;
return (