Skip to content

Commit

Permalink
Support events with mixed payloads in codegen (facebook#36942)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#36942

Changelog:
[General][Changed] - Support mixed props for events in codegen

Reviewed By: javache

Differential Revision: D44580879

fbshipit-source-id: 52f3b12795af767c038e2db7a4faf46cf2906b95
  • Loading branch information
genkikondo authored and jeongshin committed May 7, 2023
1 parent 4cd55cb commit 8cff7d6
Show file tree
Hide file tree
Showing 15 changed files with 275 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -37,6 +38,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -60,6 +62,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -83,6 +86,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -106,6 +110,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -129,6 +134,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -152,6 +158,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -161,12 +168,12 @@ void EventNestedObjectPropsNativeComponentViewEventEmitter::onChange(OnChange $e
{
auto location = jsi::Object(runtime);
{
auto source = jsi::Object(runtime);
source.setProperty(runtime, \\"url\\", $event.location.source.url);
location.setProperty(runtime, \\"source\\", source);
}
location.setProperty(runtime, \\"x\\", $event.location.x);
location.setProperty(runtime, \\"y\\", $event.location.y);
auto source = jsi::Object(runtime);
source.setProperty(runtime, \\"url\\", $event.location.source.url);
location.setProperty(runtime, \\"source\\", source);
}
location.setProperty(runtime, \\"x\\", $event.location.x);
location.setProperty(runtime, \\"y\\", $event.location.y);
$payload.setProperty(runtime, \\"location\\", location);
}
return $payload;
Expand All @@ -193,6 +200,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand Down Expand Up @@ -272,6 +280,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -295,6 +304,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -318,6 +328,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -341,6 +352,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand Down Expand Up @@ -372,6 +384,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -395,6 +408,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -418,6 +432,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -441,6 +456,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -464,6 +480,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand All @@ -487,6 +504,7 @@ Object {
#include <react/renderer/components/RNCodegenModuleFixtures/EventEmitters.h>
namespace facebook {
namespace react {
Expand Down
Loading

0 comments on commit 8cff7d6

Please sign in to comment.