Skip to content

Instantly share code, notes, and snippets.

@rodrigonehring
rodrigonehring / Snack.js
Created October 26, 2018 16:52
Snackbar to react 16.7 hooks (material-ui)
import React, { createContext, useState } from 'react'
import Snackbar from '@material-ui/core/Snackbar'
import Button from '@material-ui/core/Button'
import IconButton from '@material-ui/core/IconButton'
const Context = createContext()
function RenderSnack({ id, message, open, handleClose }) {
const messageId = `message-${id}`
return (