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: 1446981f38130243279b019f94686eb7cd46c91d
  • Loading branch information
genkikondo authored and facebook-github-bot committed Apr 18, 2023
1 parent 5c4649a commit 9253bfb
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 9253bfb

Please sign in to comment.