Add indent for event emitter header generation of codegen (#24445)

Summary:
Part of #24438, add indent foe event emitter header codegen.
cc. cpojer rickhanlonii.

[General] [Fixed] - Add indent for event emitter header generation of codegen
Pull Request resolved: https://github.com/facebook/react-native/pull/24445

Differential Revision: D14930352

Pulled By: cpojer

fbshipit-source-id: 8bd03b8e12ccf9bd06546acdb744541fcb92eea1
This commit is contained in:
zhongwuzw
2019-04-14 06:03:32 -07:00
committed by Facebook Github Bot
parent 2a4a9f86d4
commit b60651dd09
2 changed files with 8 additions and 8 deletions

View File

@@ -108,7 +108,7 @@ function generateStruct(
structNameParts,
)} ${property.name};`;
})
.join('\n');
.join('\n' + ' ');
properties.forEach((property: ObjectPropertyType) => {
const name = property.name;
@@ -165,7 +165,7 @@ function generateEvent(componentName: string, event: EventTypeShape): string {
function generateEvents(componentName: string, component): string {
return component.events
.map(event => generateEvent(componentName, event))
.join('\n\n');
.join('\n\n' + ' ');
}
module.exports = {

View File

@@ -118,8 +118,8 @@ struct EventsNestedObjectNativeComponentOnChangeLocationSourceStruct {
struct EventsNestedObjectNativeComponentOnChangeLocationStruct {
EventsNestedObjectNativeComponentOnChangeLocationSourceStruct source;
int x;
int y;
int x;
int y;
};
struct EventsNestedObjectNativeComponentOnChangeStruct {
@@ -157,9 +157,9 @@ namespace react {
struct EventsNativeComponentOnChangeStruct {
bool value;
std::string source;
int progress;
Float scale;
std::string source;
int progress;
Float scale;
};
struct EventsNativeComponentOnEventDirectStruct {
@@ -172,7 +172,7 @@ class EventsNativeComponentEventEmitter : public ViewEventEmitter {
void onChange(EventsNativeComponentOnChangeStruct value) const;
void onEventDirect(EventsNativeComponentOnEventDirectStruct value) const;
void onEventDirect(EventsNativeComponentOnEventDirectStruct value) const;
};
} // namespace react