Skip to content

Instantly share code, notes, and snippets.

@flash76
Last active March 15, 2021 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flash76/5fa4da95796b3a01f8086869b7a4a8a3 to your computer and use it in GitHub Desktop.
Save flash76/5fa4da95796b3a01f8086869b7a4a8a3 to your computer and use it in GitHub Desktop.
React Native stuff I might need later

Creating one

npx @react-native-community/bob create name-of-module

Adding iOS CocoaPods dependencies

Go into the generated native module folder, edit the name-of-module.podspec file. Add s.dependency "PodDependencyHere" for each dependency right before the end

Modular headers (not sure if this is required): go to example/ios and edit Podfile, and do use_modular_headers! or :modular_headers => true for a dependency

Adding it to your main RN app

Go to Podfile in the main project, add pod 'name-of-module', :path => '/path/to/native/module/where/the/podspec/is'
*i tried adding , :modular_headers => true here but it didn't work so I put use_modular_headers! globally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment