Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/silly-wolves-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@callstack/react-native-brownfield': patch
---

fix: fix method to deallocate reactNativeFactory instance for expo
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ struct ContentView: View {
.navigationBarHidden(true)
.clipShape(RoundedRectangle(cornerRadius: 16))
.background(Color(UIColor.systemBackground))

Button("Stop React Native") {
ReactNativeBrownfield.shared.stopReactNative()
}
.buttonStyle(PlainButtonStyle())
.padding(.top)
.foregroundColor(.red)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.padding(16)
Expand Down
15 changes: 12 additions & 3 deletions apps/AppleApp/Brownfield Apple App/components/GreetingCard.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import SwiftUI
import ReactBrownfield
import Brownie

struct GreetingCard: View {
Expand All @@ -17,10 +18,18 @@ struct GreetingCard: View {
.multilineTextAlignment(.center)
.font(.body)

Button("Increment counter") {
$counter.set { $0 + 1 }

HStack {
Button("Increment counter") {
$counter.set { $0 + 1 }
}
.buttonStyle(.borderedProminent)

Button("Stop RN") {
ReactNativeBrownfield.shared.stopReactNative()
}
.buttonStyle(.borderedProminent)
}
.buttonStyle(.borderedProminent)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ final class ExpoHostRuntime {
return
}

if let rootViewFactory = reactNativeFactory?.rootViewFactory {
(rootViewFactory as AnyObject).setValue(nil, forKey: "reactHost")
}
reactNativeFactory = nil
expoDelegate = nil
}
Expand Down
Loading