Skip to content

Commit c4ea6e3

Browse files
committed
Initial commit
1 parent fe1a48d commit c4ea6e3

16 files changed

+8532
-0
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["env", "react-app"]
3+
}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.idea
2+
dist
3+
lib
4+
node_modules
5+
npm-debug.log

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# React Toastify Redux
2+
Wraps [react-toastify](https://github.com/fkhadra/react-toastify) into a component and exposes actions and reducer.
3+
4+
## Installation
5+
```
6+
$ npm install --save react-toasify-redux
7+
$ yarn add react-toastify-redux
8+
```
9+
10+
## Usage
11+
1. Import the reducer and pass it to your combineReducers:
12+
```javascript
13+
import {combineReducers} from 'redux';
14+
import {toastsReducer as toasts} from 'react-toasify-redux';
15+
16+
export default combineReducers({
17+
// ...other reducers
18+
toasts
19+
});
20+
```
21+
22+
2. Include the toast contoller in main view.
23+
```javascript
24+
import {ToastController} from 'react-toasify-redux';
25+
26+
export default () => {
27+
return (
28+
<div>
29+
...
30+
<ToastController />
31+
</div>
32+
);
33+
};
34+
```
35+
36+
### Properties
37+
It accepts all properties as react-toastify does, actually it pipes them in the react-toastify.

externals.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
declare module "react-toastify" {
2+
export const toast: any;
3+
export type ToastType = any;
4+
export const ToastContainer: any;
5+
export type ToastContainerProps = any;
6+
}

0 commit comments

Comments
 (0)