Skip to content

Instantly share code, notes, and snippets.

@luizcalaca
Created December 27, 2022 02:29
Show Gist options
  • Select an option

  • Save luizcalaca/6f1b673df7e22c93a1743719f1d5299a to your computer and use it in GitHub Desktop.

Select an option

Save luizcalaca/6f1b673df7e22c93a1743719f1d5299a to your computer and use it in GitHub Desktop.
React.js + toast
import React from 'react'
import { toast, ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
export function App() {
function handleClick() {
toast.error('error');
}
return (
<>
<button onClick={handleClick}>
Toast
</button>
<ToastContainer autoClose={3000} position={toast.POSITION.BOTTOM_LEFT} />
</>
);
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment