onCopy={() => toast.info(<CustomToastMessage {...value} />)} >
Example #2
0
  static info = ({ text, time }, id) => {
    BackendToast.dismissIfActive(id)

    return toast.info(text, { autoClose: time })
  }
import React from 'react'
import { ToastContainer, toast, style } from 'react-toastify'

const toastContent = <div>Toast!</div>

// $ExpectError
toast(toastContent, { type: toast.TYPE.SUCCES })
toast(toastContent, { type: toast.TYPE.SUCCESS })

// $ExpectError
toast.success(toastContent, { onOpen: false })
toast.success(toastContent, { onOpen: () => console.log('open') })

// $ExpectError
toast.info(toastContent, { onClose: false })
toast.info(toastContent, { onClose: () => console.log('close') })

// $ExpectError
toast.warn(toastContent, { onOpen: false })
toast.warn(toastContent, { onOpen: () => console.log('open') })

// $ExpectError
toast.error(toastContent, { onClose: false })
toast.error(toastContent, { onClose: () => console.log('close') })

// $ExpectError
const isActiveBad: number = toast.isActive(1)
const isActiveGood: boolean = toast.isActive(1)

// $ExpectError
toast.dismiss('1')