Skip to content

Commit 07451b6

Browse files
author
Nazar Sydiaha
committed
feat: add stopReactNative usage example
1 parent ef13353 commit 07451b6

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

example/swift/App.swift

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,27 @@ struct MyApp: App {
1717
}
1818

1919
struct ContentView: View {
20-
var body: some View {
20+
var body: some View {
2121
NavigationView {
22-
VStack {
23-
Text("React Native Brownfield App")
24-
.font(.title)
25-
.bold()
26-
.padding()
27-
28-
NavigationLink("Push React Native Screen") {
29-
ReactNativeView(moduleName: "ReactNative")
30-
.navigationBarHidden(true)
31-
}
22+
VStack {
23+
Text("React Native Brownfield App")
24+
.font(.title)
25+
.bold()
26+
.padding()
27+
.multilineTextAlignment(.center)
28+
29+
NavigationLink("Push React Native Screen") {
30+
ReactNativeView(moduleName: "ReactNative")
31+
.navigationBarHidden(true)
32+
}
33+
34+
Button("Stop React Native") {
35+
ReactNativeBrownfield.shared.stopReactNative()
3236
}
33-
}.navigationViewStyle(StackNavigationViewStyle())
37+
.buttonStyle(PlainButtonStyle())
38+
.padding(.top)
39+
.foregroundColor(.red)
40+
}
41+
}
3442
}
3543
}

example/swift/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,7 +2322,7 @@ PODS:
23222322
- SocketRocket
23232323
- ReactAppDependencyProvider (0.82.1):
23242324
- ReactCodegen
2325-
- ReactBrownfield (1.2.0):
2325+
- ReactBrownfield (2.0.1):
23262326
- boost
23272327
- DoubleConversion
23282328
- fast_float
@@ -2811,12 +2811,12 @@ SPEC CHECKSUMS:
28112811
React-utils: abf37b162f560cd0e3e5d037af30bb796512246d
28122812
React-webperformancenativemodule: 50a57c713a90d27ae3ab947a6c9c8859bcb49709
28132813
ReactAppDependencyProvider: a45ef34bb22dc1c9b2ac1f74167d9a28af961176
2814-
ReactBrownfield: ba90b7c2be36c3ef4ad47e777610ca7c2b0fdf06
2814+
ReactBrownfield: 10f9f7370cd8bd6ef30eb9c736d774f9d17565f7
28152815
ReactCodegen: 878add6c7d8ff8cea87697c44d29c03b79b6f2d9
28162816
ReactCommon: 804dc80944fa90b86800b43c871742ec005ca424
28172817
RNScreens: d821082c6dd1cb397cc0c98b026eeafaa68be479
28182818
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
2819-
Yoga: 8e01cef9947ca77f0477a098f0b32848a8e448c6
2819+
Yoga: 689c8e04277f3ad631e60fe2a08e41d411daf8eb
28202820

28212821
PODFILE CHECKSUM: c4add71d30d7b14523f41a732fbf4937f4edbe0f
28222822

0 commit comments

Comments
 (0)