Skip to content

Instantly share code, notes, and snippets.

View german-bortoli's full-sized avatar
🏠
Working from home

German Bortoli german-bortoli

🏠
Working from home
View GitHub Profile
@german-bortoli
german-bortoli / SnackBarContext.tsx
Created May 19, 2022 12:13 — forked from akinncar/SnackBarContext.tsx
SnackBar Material UI Context Typescript Boilerplate
import { Snackbar } from '@material-ui/core';
import { Alert, Color } from '@material-ui/lab';
import React, { createContext, useContext } from 'react';
type SnackBarContextActions = {
showSnackBar: (text: string, typeColor: Color) => void;
};
const SnackBarContext = createContext({} as SnackBarContextActions);