New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-redux-snackbar

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-redux-snackbar

A snackbar (displays toasts) for reactjs, using the redux state container

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

react-redux-snackbar Gemnasium gzipped size

A snackbar (displays toasts) for reactjs, using the redux state container. Follows the material design guidelines. Its flexible and customizable at less than 2.5kB gzipped, and has no dependencies (other than that you must use React and Redux in your app of course).

Install

Install using yarn:

yarn add react-redux-snackbar

Or npm:

npm install --save react-redux-snackbar

Implementation

  • Add the reducer
// Somewhere where you create your redux-store:
import { createStore, combineReducers } from 'redux';
import { snackbarReducer } from 'react-redux-snackbar'; // Import it
const reducers = {
  // ... reducers ...
  snackbar: snackbarReducer // Make sure its mounted using the "snackbar" key
  // ... reducers ...
};
const reducer = combineReducers(reducers);
const store = createStore(reducer);
  • Add the React-component somewhere in your app
import { Provider }  from 'react-redux';
import { Snackbar } from 'react-redux-snackbar';

<Provider store={store}>
	// This is maybe in your App.js or something
	// Just put the component somewhere in your app
	<Snackbar />
</Provider>
  • Then use it by dispatching the redux-actions, anywhere in your app
import { showSnack, dismissSnack } from 'react-redux-snackbar';

dispatch(showSnack('myUniqueId', {
	label: 'Yay, that actually worked!',
	timeout: 7000,
	button: { label: 'OK, GOT IT' }
}));

// Should you want to remove it programatically:

dispatch(dismissSnack('myUniqueId'));

More docs coming soon

Changelog

Keywords

react redux snackbar

FAQs

Package last updated on 16 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts