You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,15 +66,15 @@ const App = () => {
66
66
};
67
67
```
68
68
69
-
Import <code>store</code> where needed - will be used to access `addNotification` and `removeNotification` API methods
69
+
Import <code>Store</code> where needed - will be used to access `addNotification` and `removeNotification` API methods
70
70
```js
71
71
import { Store } from'react-notifications-component';
72
72
```
73
73
74
74
Then call `addNotification` and watch the magic happens
75
75
76
76
```jsx
77
-
store.addNotification({
77
+
Store.addNotification({
78
78
title:"Wonderful!",
79
79
message:"teodosii@react-notifications-component",
80
80
type:"success",
@@ -108,11 +108,11 @@ For more info on how to use `animate.css`, please refer to [animate.css docs](ht
108
108
109
109
## API
110
110
111
-
`store.addNotification(options)`
111
+
`Store.addNotification(options)`
112
112
113
113
Render a new notification. Method returns a unique id for the rendered notification. Supplied options are internally validated and an exception will be thrown if validation fails.
114
114
115
-
`store.removeNotification(id)`
115
+
`Store.removeNotification(id)`
116
116
117
117
Manually remove a notification by id.
118
118
@@ -148,7 +148,7 @@ You have in total 6 containers for desktop and 2 for mobile, if component is set
148
148
*`bottom-center`
149
149
150
150
```js
151
-
store.addNotification({
151
+
Store.addNotification({
152
152
...notification,
153
153
container:'top-right'
154
154
})
@@ -168,7 +168,7 @@ List of types:
168
168
169
169
170
170
```js
171
-
store.addNotification({
171
+
Store.addNotification({
172
172
...notification,
173
173
type:'danger'
174
174
})
@@ -179,7 +179,7 @@ Will trigger a `danger` notification.
#### Dismiss notification automatically after timeout expires
194
194
195
195
```js
196
-
store.addNotification({
196
+
Store.addNotification({
197
197
...notification,
198
198
dismiss: {
199
199
duration:2000
@@ -204,7 +204,7 @@ store.addNotification({
204
204
#### Dismiss notification automatically with the time left shown on UI
205
205
206
206
```js
207
-
store.addNotification({
207
+
Store.addNotification({
208
208
...notification,
209
209
dismiss: {
210
210
duration:2000,
@@ -218,7 +218,7 @@ store.addNotification({
218
218
Easily subscribe to `onRemoval` by supplying callback as option to the notification object. Callback will get called after the removal animation finishes.
219
219
220
220
```js
221
-
store.addNotification({
221
+
Store.addNotification({
222
222
...notification,
223
223
onRemoval: (id, removedBy) => {
224
224
...
@@ -229,7 +229,7 @@ store.addNotification({
229
229
#### Pause notification's timeout by hovering
230
230
231
231
```js
232
-
store.addNotification({
232
+
Store.addNotification({
233
233
...notification,
234
234
dismiss: {
235
235
duration:2000,
@@ -241,7 +241,7 @@ store.addNotification({
241
241
#### Change transition
242
242
243
243
```js
244
-
store.addNotification({
244
+
Store.addNotification({
245
245
...notification,
246
246
slidingExit: {
247
247
duration:800,
@@ -254,7 +254,7 @@ store.addNotification({
254
254
`slidingEnter`, `touchRevert` and `touchSlidingExit` can all be configured in the same way, with the mention that `touchSlidingExit` has 2 transitions nested.
255
255
256
256
```js
257
-
store.addNotification({
257
+
Store.addNotification({
258
258
...notification,
259
259
touchSlidingExit: {
260
260
swipe: {
@@ -472,7 +472,7 @@ store.addNotification({
472
472
473
473
## Migration from v1
474
474
475
-
* Ref usage has been deprecated. Import `store` from library and use it for adding and removing notifications
475
+
* Ref usage has been deprecated. Import `Store` from library and use it for adding and removing notifications
476
476
*`touchSlidingBack` has been renamed to `touchRevert`
477
477
* Default values for transitions have been slightly changed
478
478
*`dismissIcon` has been removed. Use `showIcon` instead. If you relly on customized close icon, then stick to custom content.
0 commit comments