diff --git a/.gitignore b/.gitignore index a56a7ef..3017d0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ node_modules +/lib +/yarn.lock diff --git a/src/index.js b/src/index.js index 1a9dbb8..bd3ded9 100644 --- a/src/index.js +++ b/src/index.js @@ -111,7 +111,7 @@ class YellowBox extends Component { } componentWillUnmount() { - if (this._listener) { + if (this._listener && typeof this._listener.remove === 'function') { this._listener.remove(); } }