Skip to content

Commit

Permalink
Fix for #17348, Scrollable failing due to uglify-es
Browse files Browse the repository at this point in the history
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 b57a78c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Libraries/Components/Subscribable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

1 comment on commit b57a78c

@GospelHW
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why Subscribable.js not in v0.58.3 Libraries/Components/Subscribable.js?

Please sign in to comment.