You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using header files on iOS to specify module interfaces. For the new architecture, we are getting the interface from the codegen-generated specs. An example header file would be:
However, there is a simple problem with this approach. If you try to import this header file from the app delegate, it breaks the builds as it cannot find the spec file. An easy solution to this problem that I came across is from react-native-bootsplash.
If we update the import like this, the problem would be solved and the functionality is the same:
#ifdefRCT_NEW_ARCH_ENABLED#import <RNAwesomeLibrarySpec/RNAwesomeLibrarySpec.h> // This is changed
#import <React/RCTEventEmitter.h>
@interfaceAwesomeLibrary : NSObject<NativeAwesomeLibrarySpec>#else#import <React/RCTBridgeModule.h>
@interfaceCoreNative : NSObject<RCTBridgeModule>#endif
@end
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We are using header files on iOS to specify module interfaces. For the new architecture, we are getting the interface from the codegen-generated specs. An example header file would be:
However, there is a simple problem with this approach. If you try to import this header file from the app delegate, it breaks the builds as it cannot find the spec file. An easy solution to this problem that I came across is from react-native-bootsplash.
If we update the import like this, the problem would be solved and the functionality is the same:
Beta Was this translation helpful? Give feedback.
All reactions