Skip to content

Commit 6069721

Browse files
authored
fix: correct the paths for codegen generated header files on views (#680)
### Summary Closes #669 We were trying to import the codegen-generated view scaffold code for iOS from the `react` target. And since we now generate the codegen scaffold code for the user, it's placed under the same pod as the user's code lives. This means we can now get rid of the import path and just import using the header name. > Note: This will cause problems for users who don't ship their codegen-compiled code. Since this is not a path we want to support, there is no compatibility logic. If these users wish to go without shipping their codegen-compiled code, then they need to add those import paths again. The import paths are described in the [Official React Native documentation](https://reactnative.dev/docs/fabric-native-components-introduction?platforms=ios#2-building-your-native-code) ### Test plan 1. Generate a new view library that supports the new architecture 2. Install the pods and trigger a build on iOS 3. Make sure the example app bulids and runs fine.
1 parent 8fc684a commit 6069721

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/create-react-native-library/templates/objc-view-mixed/ios/{%- project.name %}View.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#ifdef RCT_NEW_ARCH_ENABLED
22
#import "<%- project.name -%>View.h"
33

4-
#import <react/renderer/components/RN<%- project.name -%>ViewSpec/ComponentDescriptors.h>
5-
#import <react/renderer/components/RN<%- project.name -%>ViewSpec/EventEmitters.h>
6-
#import <react/renderer/components/RN<%- project.name -%>ViewSpec/Props.h>
7-
#import <react/renderer/components/RN<%- project.name -%>ViewSpec/RCTComponentViewHelpers.h>
4+
#import "ComponentDescriptors.h"
5+
#import "EventEmitters.h"
6+
#import "Props.h"
7+
#import "RCTComponentViewHelpers.h"
88

99
#import "RCTFabricComponentsPlugins.h"
1010
#import "Utils.h"

packages/create-react-native-library/templates/objc-view-new/ios/{%- project.name %}View.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#import "<%- project.name -%>View.h"
22

3-
#import <react/renderer/components/RN<%- project.name -%>ViewSpec/ComponentDescriptors.h>
4-
#import <react/renderer/components/RN<%- project.name -%>ViewSpec/EventEmitters.h>
5-
#import <react/renderer/components/RN<%- project.name -%>ViewSpec/Props.h>
6-
#import <react/renderer/components/RN<%- project.name -%>ViewSpec/RCTComponentViewHelpers.h>
3+
#import "ComponentDescriptors.h"
4+
#import "EventEmitters.h"
5+
#import "Props.h"
6+
#import "RCTComponentViewHelpers.h"
77

88
#import "RCTFabricComponentsPlugins.h"
99

0 commit comments

Comments
 (0)