Skip to content

Instantly share code, notes, and snippets.

@petrosDemetrakopoulos
Last active May 14, 2022 17:02
Show Gist options
  • Save petrosDemetrakopoulos/ca55531bf97ee463929353240492c2cb to your computer and use it in GitHub Desktop.
Save petrosDemetrakopoulos/ca55531bf97ee463929353240492c2cb to your computer and use it in GitHub Desktop.
React toasts App.tsx
import React from 'react'
import './App.css'
import { ToastContainer, toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
function App() {
const notifyDefault = () => toast("A toast alert!");
return (
<div className="App">
<div style={{ marginTop: '2em' }}>
<button onClick={notifyDefault}>Show default toast</button>
</div>
<ToastContainer />
</div>
)
}
export default App
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment