0

I am following this documentation to implement a C++ TurboModule: https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules

I had no problem with android, but on iOS, using XCode, i get an error in the "NativeSampleModuleProvider.h" saying "No type or protocol named 'RCTModuleProvider'".

In the docs (chapter 3.1.6), the file looks like this:

#import <Foundation/Foundation.h>
#import <ReactCommon/RCTTurboModule.h>

NS_ASSUME_NONNULL_BEGIN

@interface NativeSampleModuleProvider : NSObject <RCTModuleProvider>

@end

NS_ASSUME_NONNULL_END

I am using the same code provided by the docs. AI is telling me that RCTModuleProvider is part of the old arch's infrastructure, and therefore cannot be used. Is that so? How can i get through this error?

Thank you

1
  • Please provide enough code so others can better understand or reproduce the problem. Commented May 14 at 17:57

1 Answer 1

0

I encountered the same error. For me, it was because I was on an older version of React Native, and didn't have the New Arch enabled. Upgrading to the latest version and enabling the New Architecture resolved the issue for me.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.