react-redux-toasts

1.0.0 • Public • Published

react-redux-toasts

npm package

react-redux-toasts is a React toast implemented with react-redux-toastr.

Installation

npm install --save react-redux-toasts

import {createStore, combineReducers} from 'redux'
import {toastReducer} from 'react-redux-toasts'
const reducers = {
  toastr: toastReducer
  // ... other reducers ...
}
const reducer = combineReducers(reducers)
const store = createStore(reducer)
import {Provider}  from 'react-redux'
import MToastr from 'react-redux-toasts'
 
<Provider store={store}>
    ... other things
    <MToastr />
</Provider>
import React, {Component}  from 'react'
import {mToast} from 'react-redux-toasts'
 
export class YourComponent extends Component {
  render() {
    return (
      <div>
        <button onClick={() => mToast.success({text:"Hello react !"})} type="button">Toast</button>
      </div>
    )
  }
}

Run a local demo

git clone https://github.com/djfr101/react-redux-toasts.git
cd react-redux-toasts
npm install
npm start

open your browser at http://localhost:3000

Readme

Keywords

Package Sidebar

Install

npm i react-redux-toasts

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

1.07 MB

Total Files

13

Last publish

Collaborators

  • medjfr
  • code.mac