Skip to content

Commit 511d7e8

Browse files
authored
fix(NativeModuleBase): use reflection for UWP (microsoft#1179)
This change was previously overlooked. On UWP, expressions are interpreted rather than compiled, so it's actually faster to just use direct reflection.
1 parent fcf39fb commit 511d7e8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ReactWindows/ReactNative.Shared/Bridge/NativeModuleBase.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ private static readonly IReadOnlyDictionary<string, object> s_emptyConstants
4444
/// Instantiates a <see cref="NativeModuleBase"/>.
4545
/// </summary>
4646
protected NativeModuleBase()
47+
#if WINDOWS_UWP
48+
: this(ReflectionReactDelegateFactory.Instance)
49+
#else
4750
: this(CompiledReactDelegateFactory.Instance)
51+
#endif
4852
{
4953
}
5054

ReactWindows/ReactNative.Shared/Modules/Core/Timing.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ public class Timing : ReactContextNativeModuleBase, ILifecycleEventListener
2929
/// </summary>
3030
/// <param name="reactContext">The React context.</param>
3131
public Timing(ReactContext reactContext)
32-
#if WINDOWS_UWP
3332
: base(reactContext)
34-
#else
35-
: base(reactContext, CompiledReactDelegateFactory.Instance)
36-
#endif
3733
{
3834
_timers = new HeapBasedPriorityQueue<TimerData>(
3935
Comparer<TimerData>.Create((x, y) =>

0 commit comments

Comments
 (0)