mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
922219a852
commit
f47082be11
@@ -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];
|
||||
|
||||
|
||||
+6
@@ -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
|
||||
|
||||
+10
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user