Skip to content

Commit

Permalink
Support events with mixed payloads in codegen
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[Changed][General] - Support mixed props for events in codegen

Differential Revision: D44580879

fbshipit-source-id: 7457d2a0783af0521319f2930c6e4493dcc7a272
  • Loading branch information
genkikondo authored and facebook-github-bot committed Apr 18, 2023
1 parent ee271c8 commit d72c927
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 d72c927

Please sign in to comment.