Add recursive imports for Array types

Summary: Supporting the native primitives fixture added in the previous diff

Reviewed By: JoshuaGross

Differential Revision: D16846289

fbshipit-source-id: 4c6afdabba0fe4b55990d25adec21cf65d8beff3
This commit is contained in:
Eli White
2019-08-19 11:24:49 -07:00
committed by Facebook Github Bot
parent 6ee5679582
commit 685a25ca2e
2 changed files with 13 additions and 0 deletions
@@ -494,6 +494,16 @@ function getLocalImports(
addImportsForNativeName(typeAnnotation.elementType.name);
}
if (
typeAnnotation.type === 'ArrayTypeAnnotation' &&
typeAnnotation.elementType.type === 'ObjectTypeAnnotation'
) {
const localImports = getLocalImports(
typeAnnotation.elementType.properties,
);
localImports.forEach(imports.add, imports);
}
if (typeAnnotation.type === 'ObjectTypeAnnotation') {
imports.add('#include <react/core/propsConversions.h>');
const objectImports = getImports(typeAnnotation.properties);
@@ -138,6 +138,9 @@ Map {
#pragma once
#include <react/components/view/ViewProps.h>
#include <react/graphics/Color.h>
#include <react/graphics/Geometry.h>
#include <react/imagemanager/primitives.h>
#include <vector>
namespace facebook {