Skip to content

Instantly share code, notes, and snippets.

@krescruz
Created December 20, 2017 18:10
Show Gist options
  • Save krescruz/3ac7524a514848032c48993698b32d09 to your computer and use it in GitHub Desktop.
Save krescruz/3ac7524a514848032c48993698b32d09 to your computer and use it in GitHub Desktop.
Notify example whit react toastify πŸš€
import { toast } from 'react-toastify'
const POSITION = toast.POSITION.BOTTOM_RIGHT
export const saved = (msg) => {
const detail = msg || 'Saved successful'
toast.success(detail, { position: POSITION })
}
export const invalidForm = (msg) => {
const detail = msg || 'Invalid or incomplete form'
toast.warn(detail, { position: POSITION })
}
export const oops = (msg) => {
const detail = msg || 'Oops!'
toast.error(detail, { position: POSITION })
}
@krescruz
Copy link
Author

Add more settings from here react-toastify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment