From 46981fc2587c6ef322ff659f8d64fe50675d5016 Mon Sep 17 00:00:00 2001 From: Nick Lockwood Date: Tue, 24 Feb 2015 16:33:39 -0800 Subject: [PATCH] Only update Redbox when offscreen --- ReactKit/Base/RCTRedBox.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ReactKit/Base/RCTRedBox.m b/ReactKit/Base/RCTRedBox.m index ba848e090..917331f2b 100644 --- a/ReactKit/Base/RCTRedBox.m +++ b/ReactKit/Base/RCTRedBox.m @@ -87,11 +87,13 @@ { _lastStackTrace = stack; _lastErrorMessage = message; - _cachedMessageCell = [self reuseCell:nil forErrorMessage:message]; - [_stackTraceTableView reloadData]; - [_stackTraceTableView setNeedsLayout]; if (self.hidden && shouldShow) { + + _cachedMessageCell = [self reuseCell:nil forErrorMessage:message]; + [_stackTraceTableView reloadData]; + [_stackTraceTableView setNeedsLayout]; + [_stackTraceTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO];