UNPKG

muinotify

Version:

muinotify has an imperative API that makes it easy to display snackbars, without having to handle their open/close state. It also enables you to stack them on top of one another (although this is discouraged by the Material Design guidelines).

18 lines (15 loc) 397 B
import React from "react"; import Notifier from "./context"; const withNotifier = (WrapperComponent) => { class NotifierConsumer extends React.PureComponent { render() { return ( <Notifier.Consumer> {(data) => <WrapperComponent {...this.props} {...data} />} </Notifier.Consumer> ); } } return NotifierConsumer; }; export default withNotifier;