@codeftw/future-web-ui-alert
v1.0.5
Published
Library Component React UI Alert
Downloads
10
Readme
UI Alert
Installation
npm install @codeftw/future-web-ui-alert
Usage
- Add AlertProvider wrapping your App
import { AlertProvider } from '@codeftw/future-web-ui-alert';
render(
<ApolloProvider client={client}>
<MuiThemeProvider theme={theme}>
<TunnelProvider>
<AlertProvider>
<BrowserRouter>
<AppContainer/>
</BrowserRouter>
</AlertProvider>
</TunnelProvider>
</MuiThemeProvider>
</ApolloProvider>,
document.getElementById('app')
);
- Add the Alert component somewhere in your App
import { Alert } from '@codeftw/future-web-ui-alert';
<Alert />
- Use our HOC withAlert to have access to showAlert function
import { withAlert } from '@codeftw/future-web-ui-alert';
const AddTask = withAlert(({showAlert}) => {
...
showAlert('Task added');
...
});