1

Is there any way I can use react-toastify with Reactstrap's Toast component, or the Bootstrap 4 toast classes? Here's my current config:

import { toast } from 'react-toastify'

toast.configure({
  toastClassName: 'toast', // Bootstrap class
  bodyClassName: 'toast-body', // Another Bootstrap class
});

To be clear, I am using the following libraries:

I would really like to be able to use this component as the Toast:

Ben Botvinick
  • 2,837
  • 3
  • 16
  • 41

1 Answers1

0

You can build your react component as normal and insert it instead of a plain message. The docs for react-toastify show how to do just that.

  • Build your react toast component using bootstrap 4 classes/react bootstrap
  • Place a <ToastContainer /> in your App
  • Use toast(*), where * is the component you built and imported into App

More info on this here: https://fkhadra.github.io/react-toastify/render-what-you-want