react-notification
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -126,2 +126,11 @@ var React = require('react'); | ||
componentWillReceiveProps: function (nextProps) { | ||
if (!nextProps.dismissAfter) return; | ||
if (this.state.timeoutId) clearTimeout( this.state.timeoutId ); | ||
this.state.timeoutId = setTimeout( this.hide(), nextProps.dismissAfter ); | ||
this.setState(this.state); | ||
}, | ||
render: function () { | ||
@@ -128,0 +137,0 @@ return ( |
{ | ||
"name": "react-notification", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Snackbar style notification component for React.", | ||
@@ -5,0 +5,0 @@ "main": "dist/notification.js", |
@@ -36,2 +36,3 @@ # react-notification [](http://badge.fury.io/js/react-notification) [](https://david-dm.org/pburtchaell/react-notification) | ||
| styles | object || bool | Styles to apply to the component* | | | ||
| dismissAfter | integer | Time in milliseconds to dismiss the notification (eg. `2000` for 2 seconds) | | | ||
@@ -38,0 +39,0 @@ *Setting this prop to `false` will disable all inline styles. This is useful if you aren't using React inline styles and would like to use CSS instead. See [styles](#styles) for more. |
@@ -126,2 +126,11 @@ var React = require('react'); | ||
componentWillReceiveProps: function (nextProps) { | ||
if (!nextProps.dismissAfter) return; | ||
if (this.state.timeoutId) clearTimeout( this.state.timeoutId ); | ||
this.state.timeoutId = setTimeout( this.hide(), nextProps.dismissAfter ); | ||
this.setState(this.state); | ||
}, | ||
render: function () { | ||
@@ -128,0 +137,0 @@ return ( |
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
12519
238
109
0