Skip to content

Instantly share code, notes, and snippets.

@okwasniewski
Created September 30, 2024 14:18
Show Gist options
  • Save okwasniewski/16c5b09eae29947394098f1d4bbebc7e to your computer and use it in GitHub Desktop.
Save okwasniewski/16c5b09eae29947394098f1d4bbebc7e to your computer and use it in GitHub Desktop.
ReactNativeView.swift
struct ReactNativeView: UIViewRepresentable {
var moduleName: String
var rootViewFactory: RCTRootViewFactory
func makeUIView(context: Context) -> UIView {
return rootViewFactory.view(withModuleName: moduleName)
}
func updateUIView(_ uiView: UIView, context: Context) {
// noop
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment