Permalink
Browse files

Fix for #17348, Scrollable failing due to uglify-es

Summary:
Fixes #17348 - Unhandled JS Exception: TypeError: undefined is not an object (evaluating 'this._subscribableSubscriptions.forEach')

Same existing tests applies, just added extra checks.

This patch fixes the issue #17348

 [ANDROID] [BUGFIX] [Subscribable] - Fix for #17348
 [IOS] [BUGFIX] [Subscribable] - Fix for #17348
Closes #17463

Reviewed By: sahrens

Differential Revision: D7062101

Pulled By: TheSavior

fbshipit-source-id: 1306f4695ffc8748f674de70740ded09e1e390f7
  • Loading branch information...
iMagdy authored and facebook-github-bot committed Feb 23, 2018
1 parent ef9d1fb commit b57a78c3def50eda11e57542be0e5233a62d173b
Showing with 3 additions and 1 deletion.
  1. +3 −1 Libraries/Components/Subscribable.js
@@ -28,7 +28,9 @@ Subscribable.Mixin = {
},
componentWillUnmount: function() {
this._subscribableSubscriptions.forEach(
// This null check is a fix for a broken version of uglify-es. Should be deleted eventually
// https://github.com/facebook/react-native/issues/17348
this._subscribableSubscriptions && this._subscribableSubscriptions.forEach(
(subscription) => subscription.remove()
);
this._subscribableSubscriptions = null;

0 comments on commit b57a78c

Please sign in to comment.