Components
Toast
Toast component
The Toast
component is used to show a message to the user for a short period of time. You can find it in the /components
folder.
You can use the Toast
component in your code like this:
Toast.js
import Toast from '../../../components/Toast';
const [toastVisible, setToastVisible] = useState(false);
const showToast = () => {
setToastVisible(true);
setTimeout(() => setToastVisible(false), 5500);
};
export default function toast() {
return (
<Toast visible={toastVisible} message="Hello, this is a Toast message!" />
)
}