0

toastify/dist/ReactToastify.css` and I can't manage the Toast to show in the bottom right. I'm using the exact code as the documentation. But it's not working

import { ToastContainer, toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css'; 
toast.configure();

function myComponent () {
   
   ...
   const submit = () => {
       toast.success('Your Message was sent to Wasfa Team', { poistion: toast.POSITION.BOTTOM_RIGHT });
   }
   ...
   return (
     ...
     <ToastContainer />
   )
}
SDB_1998
  • 305
  • 5
  • 18

3 Answers3

2

just use the position

import { ToastContainer, toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css'; 
toast.configure();

function myComponent () {
   
   ...
   const submit = () => {
       toast.success('Your Message was sent to Wasfa Team', { poistion: "bottom-right" });
   }
   ...
   return (
     ...
     <ToastContainer />
   )
}
1

Just set position attribute

   <ToastContainer position="bottom-right"/>
Ahmad
  • 816
  • 2
  • 9
  • 15
1

You have to define the position as a prop on ToastContainer

<ToastContainer position="bottom-right" />
Bilal Hussain
  • 572
  • 6
  • 14