Generate Props C++ structs on all platforms

Summary:
The props generator assumes that Props are used only on iOS. (i.e: the generator doesn't generate the props code if the iOS platform is excluded). However, Props are also used on Android. So, this diff makes us generate Props for all platforms.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D34559900

fbshipit-source-id: 0c25835dd57aa55a094152c147a9f952b9bc6850
This commit is contained in:
Ramanpreet Nara
2022-03-01 16:27:52 -08:00
committed by Facebook GitHub Bot
parent 922219a852
commit f47082be11
4 changed files with 16 additions and 15 deletions
@@ -126,13 +126,6 @@ module.exports = {
}
return Object.keys(components)
.filter(componentName => {
const component = components[componentName];
return !(
component.excludedPlatforms &&
component.excludedPlatforms.includes('iOS')
);
})
.map(componentName => {
const component = components[componentName];
const newName = `${componentName}Props`;
@@ -860,13 +860,6 @@ module.exports = {
}
return Object.keys(components)
.filter(componentName => {
const component = components[componentName];
return !(
component.excludedPlatforms &&
component.excludedPlatforms.includes('iOS')
);
})
.map(componentName => {
const component = components[componentName];
@@ -398,7 +398,13 @@ Map {
namespace facebook {
namespace react {
ExcludedAndroidIosComponentProps::ExcludedAndroidIosComponentProps(
const PropsParserContext &context,
const ExcludedAndroidIosComponentProps &sourceProps,
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps)
{}
} // namespace react
} // namespace facebook
@@ -626,12 +626,21 @@ Map {
*/
#pragma once
#include <react/renderer/components/view/ViewProps.h>
#include <react/renderer/core/PropsParserContext.h>
namespace facebook {
namespace react {
class ExcludedAndroidIosComponentProps final : public ViewProps {
public:
ExcludedAndroidIosComponentProps() = default;
ExcludedAndroidIosComponentProps(const PropsParserContext& context, const ExcludedAndroidIosComponentProps &sourceProps, const RawProps &rawProps);
#pragma mark - Props
};
} // namespace react
} // namespace facebook