Skip to content

Instantly share code, notes, and snippets.

@hieptl
Created September 3, 2021 05:37
Show Gist options
  • Save hieptl/bc71c7f81aa3b1181e92d6a1771a703d to your computer and use it in GitHub Desktop.
Save hieptl/bc71c7f81aa3b1181e92d6a1771a703d to your computer and use it in GitHub Desktop.
CometChatContext.js - React Mention Chat App
...
setToastMessage = (type, message) => {
switch(type) {
case "error":
this.toastRef.setError(message);
break;
case "success":
this.toastRef.setSuccess(message);
break;
case "info":
this.toastRef.setInfo(message);
break;
case "warning":
this.toastRef.setWarning(message);
break;
default:
break;
}
return null;
};
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment