Toaster for ReactJS
npm install reactjs-toastr#About
Toastr for ReactJS. Lightweight library. Easy to use.
Install via NPM
``js
npm install reactjs-toastr --save
`
Include in React Component file
`js
import React from 'react';
import { connect } from 'react-redux';
import toastr from 'reactjs-toastr';
import 'reactjs-toastr/lib/toast.css';
const mapStateToProps = state => ({
});
const mapDispatchToProps = dispatch => ({
});
class MyComponent extends React.Component {
constructor() {
super();
}
componentDidMount() {
}
render() {
return (
toastr.success('Success Message', 'Title', {displayDuration:3000})}>Show Success Message
toastr.info('Info Message', '', {displayDuration:0})}>Show Info Message
toastr.error('Error Message', 'Title')}>Show Error Message
toastr.warning('Success Message', '', {width:'600px'})}>Show Warning Message
export default connect(mapStateToProps, mapDispatchToProps)(MyComponent);
``
This module has been tested under limited scenarios. If you find any issue please feel free to report via one of the below platforms:
Email: harshdoshi999@gmail.com |
Skype: harshxxx3