Skip to content

Commit

Permalink
Move RCTNativeAnimatedModule onto the main queue
Browse files Browse the repository at this point in the history
Summary:
We're mutating dictionaries on one thread for bookkeeping (anytime we receive a call over the bridge) and iterating over them on the main thread each frame (in `updateAnimations`). Seems like this can all happen on the main thread without issue. Am I missing something?

**Test plan (required)**

Run UIExplorer NativeAnimated examples before and after - compare the results. Nothing should have changed.
Closes #9049

Differential Revision: D3682871

fbshipit-source-id: c6de62063e724b15b9678a9ef0290284e928b31b
  • Loading branch information
ryangomba authored and Facebook Github Bot 7 committed Aug 7, 2016
1 parent 6b9406e commit bf82a8d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Libraries/NativeAnimation/RCTNativeAnimatedModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ - (void)setBridge:(RCTBridge *)bridge
_propAnimationNodes = [NSMutableSet new];
}

- (dispatch_queue_t)methodQueue
{
return dispatch_get_main_queue();
}

RCT_EXPORT_METHOD(createAnimatedNode:(nonnull NSNumber *)tag
config:(NSDictionary<NSString *, id> *)config)
{
Expand Down

0 comments on commit bf82a8d

Please sign in to comment.