If you have Cocoapods in your project, you could add a post_install
script in your Podfile
.
The post_install
script would be something like this:
react_project = Xcodeproj::Project.open("../node_modules/react-native/React/React.xcodeproj")
react_project.main_group["React/Views"].files.each do |file|
if file.path.match(/^RCTWebView/)
file.remove_from_project
end
end
react_project.save
Your node_modules
directory might be different from the code I posted above, so you might want to update it.
The code above tries to remove any header (.h
) or class implementation (.m
) files that contain RCTWebView
after pod installation
Ref: https://github.com/facebook/react-native/issues/26255#issuecomment-528275747