Skip to content

Commit bf82a8d

Browse files
ryangombaFacebook Github Bot 7
authored andcommitted
Move RCTNativeAnimatedModule onto the main queue
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
1 parent 6b9406e commit bf82a8d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Libraries/NativeAnimation/RCTNativeAnimatedModule.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ - (void)setBridge:(RCTBridge *)bridge
4747
_propAnimationNodes = [NSMutableSet new];
4848
}
4949

50+
- (dispatch_queue_t)methodQueue
51+
{
52+
return dispatch_get_main_queue();
53+
}
54+
5055
RCT_EXPORT_METHOD(createAnimatedNode:(nonnull NSNumber *)tag
5156
config:(NSDictionary<NSString *, id> *)config)
5257
{

0 commit comments

Comments
 (0)