From e58829d2182d0af487836c9b4f4e33c9656e2ef3 Mon Sep 17 00:00:00 2001 From: Adam Gorman Date: Wed, 23 Oct 2019 17:16:05 -0700 Subject: [PATCH 1/4] register the empty functions --- .../Modules/Animated/NativeAnimatedModule.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.cpp b/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.cpp index 4741a58b6c1..3477089a0b4 100644 --- a/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.cpp +++ b/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.cpp @@ -151,6 +151,18 @@ NativeAnimatedModule::getMethods() { NativeAnimatedModule::RemoveAnimatedEventFromView( viewTag, eventName, animatedValueTag); }), + Method( + "startListeningToAnimatedNodeValue", // should be replaced with the s_ variation + [this](folly::dynamic args) { + const auto viewTag = facebook::xplat::jsArgAsInt(args, 0); + NativeAnimatedModule::StartListeningToAnimatedNodeValue(viewTag); + }), + Method( + "stopListeningToAnimatedNodeValue", // should be replaced with the s_ variation + [this](folly::dynamic args) { + const auto viewTag = facebook::xplat::jsArgAsInt(args, 0); + NativeAnimatedModule::StopListeningToAnimatedNodeValue(viewTag); + }), }; } From 7fe94c3453054779d8004da83f3e7efd1c433caa Mon Sep 17 00:00:00 2001 From: Adam Gorman Date: Wed, 23 Oct 2019 17:21:31 -0700 Subject: [PATCH 2/4] register empty stubs --- vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.cpp | 8 ++++++-- vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.cpp b/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.cpp index 3477089a0b4..1fc741045e3 100644 --- a/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.cpp +++ b/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.cpp @@ -39,6 +39,10 @@ const char *NativeAnimatedModule::s_addAnimatedEventToViewName{ "addAnimatedEventToView"}; const char *NativeAnimatedModule::s_removeAnimatedEventFromViewName{ "removeAnimatedEventFromView"}; +const char *NativeAnimatedModule::s_startListeningToAnimatedNodeValue{ + "startListeningToAnimatedNodeValue" }; +const char *NativeAnimatedModule::s_stopListeningToAnimatedNodeValue{ + "stopListeningToAnimatedNodeValue" }; NativeAnimatedModule::NativeAnimatedModule( const std::weak_ptr &reactInstance) @@ -152,13 +156,13 @@ NativeAnimatedModule::getMethods() { viewTag, eventName, animatedValueTag); }), Method( - "startListeningToAnimatedNodeValue", // should be replaced with the s_ variation + s_startListeningToAnimatedNodeValue, [this](folly::dynamic args) { const auto viewTag = facebook::xplat::jsArgAsInt(args, 0); NativeAnimatedModule::StartListeningToAnimatedNodeValue(viewTag); }), Method( - "stopListeningToAnimatedNodeValue", // should be replaced with the s_ variation + s_stopListeningToAnimatedNodeValue, [this](folly::dynamic args) { const auto viewTag = facebook::xplat::jsArgAsInt(args, 0); NativeAnimatedModule::StopListeningToAnimatedNodeValue(viewTag); diff --git a/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.h b/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.h index ffaf38cf1ef..f048714e2bb 100644 --- a/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.h +++ b/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.h @@ -115,6 +115,8 @@ class NativeAnimatedModule final : public facebook::xplat::module::CxxModule { static const char *s_extractAnimatedNodeOffsetName; static const char *s_addAnimatedEventToViewName; static const char *s_removeAnimatedEventFromViewName; + static const char *s_startListeningToAnimatedNodeValue; + static const char *s_stopListeningToAnimatedNodeValue; }; } // namespace uwp } // namespace react From 9a9ac77cda1f1ed408781708610687e0a2b5db74 Mon Sep 17 00:00:00 2001 From: Adam Gorman Date: Wed, 23 Oct 2019 17:22:31 -0700 Subject: [PATCH 3/4] Change files --- ...2019-10-23-17-22-31-user-adamgor-fixStartAnimate.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 change/react-native-windows-2019-10-23-17-22-31-user-adamgor-fixStartAnimate.json diff --git a/change/react-native-windows-2019-10-23-17-22-31-user-adamgor-fixStartAnimate.json b/change/react-native-windows-2019-10-23-17-22-31-user-adamgor-fixStartAnimate.json new file mode 100644 index 00000000000..909d06f4f42 --- /dev/null +++ b/change/react-native-windows-2019-10-23-17-22-31-user-adamgor-fixStartAnimate.json @@ -0,0 +1,9 @@ +{ + "type": "prerelease", + "comment": "Register 2x NYI stubs for NativeAnimatedModule", + "packageName": "react-native-windows", + "email": "adamgor@microsoft.com", + "commit": "7fe94c3453054779d8004da83f3e7efd1c433caa", + "date": "2019-10-24T00:22:31.233Z", + "file": "F:\\GS\\repo\\RNW\\change\\react-native-windows-2019-10-23-17-22-31-user-adamgor-fixStartAnimate.json" +} \ No newline at end of file From 85f803e7ab84be097509c9164f8cdc17b66e269e Mon Sep 17 00:00:00 2001 From: Adam Gorman Date: Wed, 23 Oct 2019 17:25:59 -0700 Subject: [PATCH 4/4] add postfix Name for consistency --- vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.cpp | 8 ++++---- vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.cpp b/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.cpp index 1fc741045e3..ef8a5d0fa4c 100644 --- a/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.cpp +++ b/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.cpp @@ -39,9 +39,9 @@ const char *NativeAnimatedModule::s_addAnimatedEventToViewName{ "addAnimatedEventToView"}; const char *NativeAnimatedModule::s_removeAnimatedEventFromViewName{ "removeAnimatedEventFromView"}; -const char *NativeAnimatedModule::s_startListeningToAnimatedNodeValue{ +const char *NativeAnimatedModule::s_startListeningToAnimatedNodeValueName{ "startListeningToAnimatedNodeValue" }; -const char *NativeAnimatedModule::s_stopListeningToAnimatedNodeValue{ +const char *NativeAnimatedModule::s_stopListeningToAnimatedNodeValueName{ "stopListeningToAnimatedNodeValue" }; NativeAnimatedModule::NativeAnimatedModule( @@ -156,13 +156,13 @@ NativeAnimatedModule::getMethods() { viewTag, eventName, animatedValueTag); }), Method( - s_startListeningToAnimatedNodeValue, + s_startListeningToAnimatedNodeValueName, [this](folly::dynamic args) { const auto viewTag = facebook::xplat::jsArgAsInt(args, 0); NativeAnimatedModule::StartListeningToAnimatedNodeValue(viewTag); }), Method( - s_stopListeningToAnimatedNodeValue, + s_stopListeningToAnimatedNodeValueName, [this](folly::dynamic args) { const auto viewTag = facebook::xplat::jsArgAsInt(args, 0); NativeAnimatedModule::StopListeningToAnimatedNodeValue(viewTag); diff --git a/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.h b/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.h index f048714e2bb..9eee1ea44cd 100644 --- a/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.h +++ b/vnext/ReactUWP/Modules/Animated/NativeAnimatedModule.h @@ -115,8 +115,8 @@ class NativeAnimatedModule final : public facebook::xplat::module::CxxModule { static const char *s_extractAnimatedNodeOffsetName; static const char *s_addAnimatedEventToViewName; static const char *s_removeAnimatedEventFromViewName; - static const char *s_startListeningToAnimatedNodeValue; - static const char *s_stopListeningToAnimatedNodeValue; + static const char *s_startListeningToAnimatedNodeValueName; + static const char *s_stopListeningToAnimatedNodeValueName; }; } // namespace uwp } // namespace react