fix incorrect count for layoutAnimation callback

Summary:
fixes #3106
Having -1 would trigger callback one frame early causing it to be ignored on the next frame.
Closes https://github.com/facebook/react-native/pull/3190

Reviewed By: svcscm

Differential Revision: D2783700

Pulled By: mkonicek

fb-gh-sync-id: 02070f70915055aec3b1543a8d553f2680438611
This commit is contained in:
John Ku
2015-12-22 10:02:47 -08:00
committed by facebook-github-bot-3
parent c866a0a6d0
commit c34ef25ec5

View File

@@ -553,7 +553,7 @@ extern NSString *RCTBridgeModuleNameForClass(Class cls);
void (^completion)(BOOL) = ^(BOOL finished) {
completionsCalled++;
if (callback && completionsCalled == frames.count - 1) {
if (callback && completionsCalled == frames.count) {
callback(@[@(finished)]);
}
};