react-native-bottom-snackbar
Version:
snackbar component for react-native (android/ios)
28 lines • 1.03 kB
JavaScript
/* eslint-disable */
import React, { createRef } from 'react';
import { SnackbarComponent } from './AlertComponent';
var _snackbarRef = createRef();
var AlertBottomSnackbar = function (props) { return (<SnackbarComponent ref={_snackbarRef} {...props}/>); };
/**
* @param message The message that you want to show.
* @param type Type must be any of these: "normal", "error", "success", "info", "warn" DEFAULT: "normal".
* @param onClose callback will run only if snackbar get closed automatically.
*/
AlertBottomSnackbar.show = function (message, type, onClose) {
var _a;
if (type === void 0) { type = "normal"; }
(_a = _snackbarRef.current) === null || _a === void 0 ? void 0 : _a.show({
message: message,
type: type,
onClose: onClose
});
};
/**
* closes all opened snackbar.
*/
AlertBottomSnackbar.close = function () {
var _a;
(_a = _snackbarRef.current) === null || _a === void 0 ? void 0 : _a.close();
};
export { AlertBottomSnackbar };
//# sourceMappingURL=index.js.map